Skip to main content
December 19, 2010
Answered

Java and Air in Android

  • December 19, 2010
  • 1 reply
  • 1235 views

Hi,

I wonder if a Native Android application can start an Air application then work together by passing data to each other in runtime and sharing the same SQL lite database?

This topic has been closed for replies.
Correct answer Joe ... Ward

Thanks Joe, but I dont really need a concurrent access to the database. I am pretty ok if  both applications can use the same SQL DB by making separate connections when it is not in use and getting disconnected after the DB operation. Do you think Android can handle that?

Even more important question when we write a socket server do you think the single-threaded air app. can communicate with it smoothly without causing any performance problem ?


Thanks Joe, but I dont really need a concurrent access to the database.

I am pretty ok if  both applications can use the same SQL DB by making

separate connections when it is not in use and getting disconnected

after the DB operation. Do you think Android can handle that?

Then it comes down to accessing a file, which Android should handle fine (it is Linux at heart). You could save the database on the SDCard, or, possibly, assign a shared ID to both apps (and sign them with the same certificate) and store the database in one of the apps own section of the filesystem.

Even more important question when we write a socket server do you think

the single-threaded air app. can communicate with it smoothly without

causing any performance problem ?

It should be fine. If you are processing lots of data, you might want to implement "pseudo-threading" so that you only process a limited number of records at one time. This gives the UI code a chance to update between batches. The same concept holds whether or not you use sockets. And note that ActionScript is single-threaded, but the runtime uses multiple threads in the background.

1 reply

December 29, 2010

In theory i believe its possible. If maybe your app share the same Domain as its counterpart and accessing the SQL database by using the same name should work...

not 100% sure, I believe doing some research on the Android side of things (how Android manages SQL database) might give you a stable answer.

Participating Frequently
January 5, 2011

An AIR app could register a custom intent in its application descripptor that the Java app could then use to start the AIR app.

The AIR SQL API isn't designed for concurrent users, so you could not share data using a single database file. The Java app could implement a SocketServer that the AIR app can connect to, to share data.

January 6, 2011

Thanks Joe, but I dont really need a concurrent access to the database. I am pretty ok if  both applications can use the same SQL DB by making separate connections when it is not in use and getting disconnected after the DB operation. Do you think Android can handle that?

Even more important question when we write a socket server do you think the single-threaded air app. can communicate with it smoothly without causing any performance problem ?