How to store data accessible to both a web site and android application?

I’m developing an Android and web application that will function as a service (use the same data).

My question is how should the data be stored to allow for both the web and the android application to have access to the same set of data?

Should the android application connect to the sites MySQL server to store/access data?

If so how do I allow someone to access the data when they are not in a service area?

Asked by: Andrew279 | Posted: 25-01-2022

Answer 1

It sounds like you need to provide a REST or SOAP interface to the data on your webserver so that the Android app can get at it. As for providing access when not in a service area you would need to cache the data, or provide some sort of full data sync capabilities, to keep a working copy of the data on the Android device. I would recommend against letting Android devices connect directly to an external database, if that's even possible.

Do you have a fully functional web app that you are just copying as an Android app? If so I would suggest that you consider just letting Android users view your site via the web browser. Perhaps provide a more mobile friendly version of the CSS. This will get you Android, iPhone, Blackbeery and Windows Mobile support. If you need that webapp to be accessible when devices are not in a service area you could look into Google Gears or HTML5 client side database support. That would make your webapp accessible on Android devices that aren't in a service area (not sure about Gears or HTML5 support on other mobile devices), and it would also provide that functionality on notebooks/netbooks and other portable devices that might go in and out of service areas.

Answered by: David283 | Posted: 26-02-2022

Similar questions

java - Global Objects accessible throughout Android application

This question already has answers here:

Android:- How to Make dynamic HashMap Accessible in whole application?

This question already has answers here:

java - Using different input methods on android accessible application

I'm working on an accessible aplication for blind users, and I want my app to use the input method I configured in app preferences when I focus any EditText. The input methods are: Standard Android keyboard Voice recognition Gestures Which is the best way to do this? I guess one way will be adding a listener on all EditTexts and calling an Activity with the sel...

android - App's Files folder accessible to another application

I have two apps that generate some files, I would like these files to be synchronized on a server. To avoid code duplication I'm creating only one background worker thread to synchronize these files. At this point I have two independent question: Is it a good practice to have one worker thread synchronizing two applications's files on the server ? Let's say the worker thread is in app1 how can app1 a...

android - Where to put an asset file to be accessible for an application?

Got some updates recently, i.e. moved from Eclipse to Android Studio and started using Gradle. Besides, my target API got updated from 16 to 20 and things are not working as they used to. I started refactoring a part of my application responsible for fetching a database file. But LogCat reports no assets in application/app/assets directory, (assets is at the same level as src ...

java - How do I make an instance available or accessible from anywhere in my android application

I'm new in android and I have a question. I want to have just one instance of a class in my whole android program so that it's attributes won't change during the program, but I also want to call it's methods in all my activities. With some search I realized that I can pass my object via implementing class as Serializable or Parcelable. I did this but I got following error: java.lang.RuntimeE...

java - Methods declared in Application not accessible

Manifest.xml: <application android:name="" android:label="@string/app_name" android:supportsRtl="true"> </application> My public class App extends Application { protected List<Contact> main_contacts = null; public void setMainContacts(List<Contact> contacts) { ...

How to add a JNI C function, accessible as a java method, into my android application?

I want to know how to(from android-studio or by modifying the build files), add a C/C++ file with a function that shows up as a java accessible method.

android - Google play application is not accessible by search on any devices, but can be accessed through the link in the google play console

I have made an application, and have gone through the whole process of getting it ready for pre-register. It has been up for pre-register for almost two days now, and I cannot access or see the application on any device from google play. However, I can see the application perfectly fine through the link from the google play console. I know I have a unique name, and I know the issue is not indexing because I have looked up ...

android application memory leaks

I am using kind of results search engine, problem is to remember the searching criteria i made singleton static class which keeps only one instance. In my application there are lots of class level private variables, lots of public static variables, a big util class which contains only static final methods. problem is my application get crash any time any where any spot and interesting thing is crash code a...

Android Application data should not be released by android OS

public class MYApplication extends Application { String property; setter getter } does above code make sure property will not be collectied by android OS if not used for a long period of time.

Android Email application - Is it possible to get all the details which are configured in Email application

Is there any way to get in the code: Email id Password SMTP host SMTP port which the user used to setup his Email account with the Android built in Email application Required because, I am written a MailSender class using JavaMail API there I need to send the mail using the details what user configured in Built in Android Email application.

Android Intent for Twitter application

Is it possible to show a list of applications (with intent.createChooser) that only show me my twitter apps on my phone (so htc peep (htc hero) or twitdroid). I have tried it with intent.settype("application/twitter") but it doesnt find any apps for twitter and only shows my mail apps. Thank you, Wouter

webserver - Retrieve data from a web server for android application

I am developing an application that needs to retrieve some data from a web server. But I have no idea how can this be possible?

Should a legacy Android application be rebuilt using SDK 2.1?

I have an Android application that uses the well known Strategies for Legacy Applications. It is build with the Android SDK 2.0 with manifest settings minSdkVersion="3" (API 1.5) and targetSdkVersion="5" (2.0). Question1: Since maxSdkVersion is not specified, the application should be...

android - Intent to pick an installed application slow in my activity, why?

If you long press on your homescreen and pick to add an application shortcut, you will be greeted with a listview showing all of your instal applications. I needed this same functionality in my application so I copied the intent from the launcher source: Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); Intent pic...

Android 1.6 SMS (older application code)

I have HTC Tattoo with Android 1.6. I have maed a Java program for SMS sending. I got the source on the Internet, I think, versions before 1.6. The problem is: SMSs are sent twice. What is a possible cause for this problem? If possible, please simply post sample code what works OK.

How to close Android application?

I want to close my application, so that it no longer runs in the background. How to do that? Is this good practice on Android platform? If I rely on the "back" button, it closes the app, but it stays in background. There is even application called "TaskKiller" just to kill those apps in the background.

listview - android application failing upon user scrolling - no 'obvious' error

I'm having a strange problem with Android 1.6 I have an application that has a ListView (found in Activity #1). The user can click on one of the rows in the ListView and is taken to a 2nd Activity (Activity # 2). User can then use the back button to go back to the ListView. The problem is that if the user scrolls down the list after returning from Activity # 2 the application crashes, bu...

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Android