P Pelky Active Member Licensed User Longtime User Mar 13, 2012 #1 I am using a Widget to allow me to touch the screen to start timing .. When I hit the widget again it writes a record away (sql). At a later date I need to update the record with details of my activities so am using an app to try and read and update those records... How do I describe the Database to allow access from 1 or more apps and maybe to copoy across to a PC for further analysis?... Also how do you test the access on the PC ??? Thanks Guys
I am using a Widget to allow me to touch the screen to start timing .. When I hit the widget again it writes a record away (sql). At a later date I need to update the record with details of my activities so am using an app to try and read and update those records... How do I describe the Database to allow access from 1 or more apps and maybe to copoy across to a PC for further analysis?... Also how do you test the access on the PC ??? Thanks Guys
P Penko Active Member Licensed User Longtime User Mar 13, 2012 #2 How about putting the database on the SDK and share it among the two applications? I am not sure if it will work but you may give it a try. On a PC you just have to use some SQLite library and open the database. Upvote 0
How about putting the database on the SDK and share it among the two applications? I am not sure if it will work but you may give it a try. On a PC you just have to use some SQLite library and open the database.
P Pelky Active Member Licensed User Longtime User Mar 13, 2012 #3 Thanks - I hear you but I am so new at this and am not sure what u mean. Will the database be available to multiple apps and if so how do i go about putting it on the SDK?... I did get a DB reader but have no idea where B4 puts a database once created Upvote 0
Thanks - I hear you but I am so new at this and am not sure what u mean. Will the database be available to multiple apps and if so how do i go about putting it on the SDK?... I did get a DB reader but have no idea where B4 puts a database once created
P Pelky Active Member Licensed User Longtime User Mar 13, 2012 #4 Penko said: How about putting the database on the SDK and share it among the two applications? I am not sure if it will work but you may give it a try. On a PC you just have to use some SQLite library and open the database. Click to expand... Thanks - I hear you but I am so new at this and am not sure what u mean. Will the database be available to multiple apps and if so how do i go about putting it on the SDK?... I did get a DB reader but have no idea where B4 puts a database once created Upvote 0
Penko said: How about putting the database on the SDK and share it among the two applications? I am not sure if it will work but you may give it a try. On a PC you just have to use some SQLite library and open the database. Click to expand... Thanks - I hear you but I am so new at this and am not sure what u mean. Will the database be available to multiple apps and if so how do i go about putting it on the SDK?... I did get a DB reader but have no idea where B4 puts a database once created
D DouglasNYoung Active Member Licensed User Longtime User Mar 13, 2012 #5 Pelsky, There is nothing to stop you putting the file on the root of the sd card, or a sub-directory, which will be available to any application. If you distribute the database with the apk then you just need to test for its existence on start up (Activity_Create) and copy it if its not already there. e.g. Code: If FirstTime Then If File.Exists(File.DirRootExternal, "db_name") = False Then File.Copy(File.DirAssets, "db_name", File.DirRootExternal, "db_name") End If End If You could substitute File.DirRootExternal with File.DirDefaultExternal, which will put it in /Android/data/yourpackagename/file, which is visible also to all applications. Have a look at Files - Basic4android Wiki Hope this helps, Douglas Upvote 0
Pelsky, There is nothing to stop you putting the file on the root of the sd card, or a sub-directory, which will be available to any application. If you distribute the database with the apk then you just need to test for its existence on start up (Activity_Create) and copy it if its not already there. e.g. Code: If FirstTime Then If File.Exists(File.DirRootExternal, "db_name") = False Then File.Copy(File.DirAssets, "db_name", File.DirRootExternal, "db_name") End If End If You could substitute File.DirRootExternal with File.DirDefaultExternal, which will put it in /Android/data/yourpackagename/file, which is visible also to all applications. Have a look at Files - Basic4android Wiki Hope this helps, Douglas
P Pelky Active Member Licensed User Longtime User Mar 13, 2012 #6 Douglas U R a Gods Send... Thanks very much.... I haven't tried it yet as I am up to my ears with other 'MAKE IT NICE' stuff but I will give it a go soon - looks like the answer tho... It really is appreciated.... Upvote 0
Douglas U R a Gods Send... Thanks very much.... I haven't tried it yet as I am up to my ears with other 'MAKE IT NICE' stuff but I will give it a go soon - looks like the answer tho... It really is appreciated....
P Penko Active Member Licensed User Longtime User Mar 13, 2012 #7 I am not sure if concurrent access is allowed but after all, it is just one application that can uses the database(unless it is a service but this is another story) and concurrency is not the case here. Depending on what you want to achieve, you can upload data via FTP to your server, send via Sockets, etc... Everything is up to you, B4A and Android system are both powerful enough to handle your needs. Don't hesitate to ask for further help. Upvote 0
I am not sure if concurrent access is allowed but after all, it is just one application that can uses the database(unless it is a service but this is another story) and concurrency is not the case here. Depending on what you want to achieve, you can upload data via FTP to your server, send via Sockets, etc... Everything is up to you, B4A and Android system are both powerful enough to handle your needs. Don't hesitate to ask for further help.
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2012 #8 A database can be accessed from multiple applications at the same time. Upvote 0