Background service to access websql/sqlite in android? - android

I'm doing jquery mobile application for android with html5. We use websql for the local data storage. Is it possible to run a service in background which can access this db and upload some data from local DB to the server SQL DB? I really don't have any idea about it. Please suggest.
Heard that in browser we can't do such background services. If I move my data from websql to android supported SQLite, is it possible to run a service to upload this data?
I wants to have,
Run the service & upload data even if the application is closed.
Send & complete request if I redirect through my application pages

Related

How to update android local sqlite database from web using internet connection?

I have developed an educational android application. I have also developed a web application to insert questions on the web and download in android sqlite database. And also the test result is uploaded to the web. The application is working locally without internet when its database is updated.
My Problem: I want to update my android application's sqlite database from my website using internet and to upload test result after someone completed the test. So, give me information programmatilly as soon as possible to update my android app from my website and to upload test result from android app to my website.
I will be highly thankful!
That is not a good practice to change your local sqlite database from web directly. You need to store your activities status in an external database (probably on your web server) and let your android app talk to your server and ask for update or new results (preferably a JSON response) and let you app update your local database.
If you want to get notified if anything has changed on your server you can use Google Cloud Messaging (GCM) or you can write a SyncAdapter to poll the server periodically to get the latest changes.
But never try to update your local sqlite database from web!

Meteorjs, cordova and local mongodb (online & offline mode)

I have a question about meteorjs and cordova mobile app development: will mongodb work locally on my mobile app (built with meteorjs and cordova) even if I turn internet connection off ?
My app will require only locally stored data (but need more space than localstorage provides) and I'm not sure how Meteorjs-cordova apps works after compilation to mobile (android & iOS) - does it have its own MongoDB instance inside it?
And if yes, is it possible to run it in offline mode?
Scenario:
internet connection is needed only on 1st run to download data, next time You can load everything locally and don't need to be connected to the internet.
Any information will be appreciated.
Your mobile app won't have an exact MongoDB instance on it, but you can use minimongo to store data in-memory on the client-side. So if you pull data from your server MongoDB instance, it'll be stored in minimongo until your app is closed. The data isn't persistent so you'll need something like this package to save data between launches.
See this answer for more information

Communication between website and android app

I want to build a website, where the data will be saved in a data base, logical in a sql database. Also, I want to build an android app, which will take the data from the above (sql) data base. How can I achieve it? I mean how can I manage the communication between the website and the android app. In past, I have create website with php and sql and also I have build android apps, but now I want to achieve the communication between them. Can I use parse platform?
FYI, without any server communication you can't use the website database in android application.
If you want to manage the communication between the website and the android app means you need a centralized server which having the data of your web/mobile applications. So, after that by using the web service methods (REST/SOAP) you can achieve the communication between them.
yeah unfortunately chrome won't let webapps use local storage on android. what you can do is create a local server (using org.apache.http package for example), let it run as a background android service, then have the website make requests to that url. Its considered hacky, but it would work. You can post whatever data you wanted the website to know about , and then get it from the website.

Phone Gap Cross Platform Apps

I am new to the mobile development. I am taking online classes and researching, but normally is it a requirement to have a backend database to store information for a mobile phone app or where is data normally handled with phone apps? I'm thinking of even simple examples of storing phone call logs or task items for user retrieval. Also authentication, when setting up logins, would this happen normally from a backend database or authentication server that the app creater needs to maintain?
THank in advance
Typically back end data is stored in a database in a server as done in web apps. Then you will expose the data using an HTTP based service (e.g. ASP.NET Web API) so that its easy for JavaScript to communicate with the service. data is commonly encoded as JSON transferring data between the service and your app. Now your mobile app will take data from the service and display in the UI and for updates data is send to the service and the service updates it to the database.

Can you use the database on a website for android?

I'm developing an app and a website simultaneously. The website will be done in django and using Google' app engine, so therefore Google's database. IS there anyway i can download and use the database for an android app? Preferably I would like it to download and make it available offline to the users.
use a REST api like django tastypie on the server side, and consume the rest resources for the models you need with your android app. After you get the Json/xml messages on your android just save it to the local sqllite db
Android does provide a SQLite interface for you to read and write to a local db. You could fetch the db through a web request and save it locally, yes. Being on Google App Engine does not help / hinder your ability to do this.

Categories

Resources