Reputation: 87
Does anybody have any idea how to send data from an App Inventor app and the receive it in an app made in Eclipse.
I need to launch the app from within App inventor (already done this part) and send a string of data from app inventor to the other app and then manipulate the data in the other app.
Any help would be highly appreciated
Thanks Patrick
Upvotes: 1
Views: 490
Reputation: 75
Patrick's answer is the preferred one, but if you really do want to do something like Einar mentioned (i.e. open a socket) you could have your Eclipse-based app run a small HTTP server and use App Inventor's Web component to communicate to it.
Upvotes: 1
Reputation: 87
So I finally figured it out.
Here is my code from both apps:
App Inventor: In the Activity Starter settings you need the following:
ActivityPackage: something.something.Packagename
ActivityClass: something.something.Packagename.classname
ExtraKey: APP_INVENTOR_START
ExtraValue: Value that you would like to send.
This how you receive the value in Eclipse app:
Bundle extras = getIntent().getExtras();
String ReceivedValue = extras.getString("APP_INVENTOR_START");
YES. IT IS REALLY AS SIMPLE AS THAT!
Upvotes: 1
Reputation: 4433
If exchange of variables is impossible you might be able to do it opening à socket. If they both run on the same machine the latency would not be too high.
Upvotes: 0