Patrick Doyle
Patrick Doyle

Reputation: 87

Getting Data from App Inventor app in Eclipse app

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

Answers (3)

Mark Friedman
Mark Friedman

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

Patrick Doyle
Patrick Doyle

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

Einar Sundgren
Einar Sundgren

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

Related Questions