marcel Active Member Licensed User Longtime User Nov 5, 2012 #1 Hi, I am new to basic4android. I have programmed on dotnet and iPhone. now I need to make my app working on android and I think using basic4android should do it. I already made some simple tests and it worked great! My questions. I strugle a little bit how to setup the code structure. My app would be very simple It needs to poll every x minutes data from a webservice and store this in the app using SQLite and based on the GPS Location it will display items on a listview. So I was thinking to use a service Module to download the data and store this into a SQLDatabase every x minutes. But I do not know eaxtly what to do with the GPS. Can I put this also in the service and send an event everytime there is a reasonable gps change to the main thread to update the listview? Is this possible? Is this correct thinking? Thanks for an anwser! Last edited: Nov 5, 2012
Hi, I am new to basic4android. I have programmed on dotnet and iPhone. now I need to make my app working on android and I think using basic4android should do it. I already made some simple tests and it worked great! My questions. I strugle a little bit how to setup the code structure. My app would be very simple It needs to poll every x minutes data from a webservice and store this in the app using SQLite and based on the GPS Location it will display items on a listview. So I was thinking to use a service Module to download the data and store this into a SQLDatabase every x minutes. But I do not know eaxtly what to do with the GPS. Can I put this also in the service and send an event everytime there is a reasonable gps change to the main thread to update the listview? Is this possible? Is this correct thinking? Thanks for an anwser!
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2012 #2 Use HttpUtils2 to download the data. You can use a single service for both the GPS and the data download. Your code always runs in the main thread (unlike libraries code). You can use CallSubDelayed to update the activity with the ListView whenever required. Upvote 0
Use HttpUtils2 to download the data. You can use a single service for both the GPS and the data download. Your code always runs in the main thread (unlike libraries code). You can use CallSubDelayed to update the activity with the ListView whenever required.
marcel Active Member Licensed User Longtime User Nov 7, 2012 #3 Erel said: Use HttpUtils2 to download the data. You can use a single service for both the GPS and the data download. Your code always runs in the main thread (unlike libraries code). You can use CallSubDelayed to update the activity with the ListView whenever required. Click to expand... Ok. Thanks again Erel. I will try this. Upvote 0
Erel said: Use HttpUtils2 to download the data. You can use a single service for both the GPS and the data download. Your code always runs in the main thread (unlike libraries code). You can use CallSubDelayed to update the activity with the ListView whenever required. Click to expand... Ok. Thanks again Erel. I will try this.
marcel Active Member Licensed User Longtime User Nov 12, 2012 #4 SQL Decleration Hi, Where do I put the SQL decleration, i need this in my activity, service and helper modules... Is this save to put this on Process_Globals in the Main Activity? Marcel Last edited: Nov 12, 2012 Upvote 0
SQL Decleration Hi, Where do I put the SQL decleration, i need this in my activity, service and helper modules... Is this save to put this on Process_Globals in the Main Activity? Marcel
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2012 #5 SQL should be declared as a process global variable. Upvote 0
marcel Active Member Licensed User Longtime User Nov 13, 2012 #6 Erel said: SQL should be declared as a process global variable. Click to expand... Does it matter if this is in the service or in the activity? Are they after compiling addup to one list? Upvote 0
Erel said: SQL should be declared as a process global variable. Click to expand... Does it matter if this is in the service or in the activity? Are they after compiling addup to one list?
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2012 #7 It doesn't matter as these variables are tied to the process and not to any module. Upvote 0
marcel Active Member Licensed User Longtime User Nov 13, 2012 #8 Erel said: It doesn't matter as these variables are tied to the process and not to any module. Click to expand... Ok, This make sence. Great! Thanks again! I really appriciate this!:sign0098: Upvote 0
Erel said: It doesn't matter as these variables are tied to the process and not to any module. Click to expand... Ok, This make sence. Great! Thanks again! I really appriciate this!:sign0098: