Cross-platform solution for mobile applications

I am developing a mobile application that can be run on mobile devices (with OSs such as Android, iOS, WP7 ...). This application will receive data from an online database, then save it in a local database on the device, and I can do CRUD with the data. There are three ideas:

  • I will create a web service to work with the database on the host and use some cross-platform framework to create the application, and then connect to the web service to receive and put data on the server. Questions:

    • What technology should I use to create a web service? (RESTful / SOAP ...?)
    • What type of data is returned for convenient processing? (XML / JSON ...?)
    • How to synchronize between a local database and a database on a host?
  • I will create an application to download an external URL and create a website (with all the functions that I need to work with the database). Questions:

    • iOS, Android, WP7 ... accept to load an external url in apps?
    • How to sync data like my first idea?
    • Should I use single-page application technology?
  • I will create an application using a cross-platform structure, and it will work with a local database. I just handle the synchronization between the local database and the host database. Problem: is this the best database and the best structure for this?

thanks

+4
source share
3 answers
How to sync between local database and database on host? 

For synchronization, you can take a look at the open source project, the OpenMobster Sync service. You can perform all types of synchronization operations.

  • double sided
  • one-way client
  • one-way device
  • Bootup.

In addition, all changes are automatically tracked and synchronized with the cloud. You can disconnect your application when the network connection is disconnected. It will track any changes and automatically synchronize it with the cloud in the background when the connection returns. In addition, when new data is created in the Cloud, it is automatically synchronized with the local database using push notifications.

Currently, only its own development on Android and iOS is supported. However, the next release of 2.2-M8 (end of March) will support end-to-end integration with PhoneGap on Android and 2.2-M9 (end of April), iOS will add.

PhoneGap support will give you the flexibility to build applications using web technologies such as HTML5, and JavaScript along with Sync for your local data using OpenMobster.

If you want to switch to pure native, you can still use the synchronization service and synchronize your local database with the remote database.

Let me know if you have additional questions about the structure.

Here is a link to an open source project: http://openmobster.googlecode.com

Good luck !!!

+3
source

Some suggestions:

  • If you plan to have your mobile application communicate with the server, I highly recommend that you use RESTful services. XML overloading associated with SOAP services can cause problems with the phone and your network.
  • The returned data may be JSON or XML. For example, in Blackberry applications, I prefer XML because support is included in the SDK.
  • There are three types of mobile applications: web applications (assembly using HTML / Javascript and browser access), native applications (installed on the device and encoded in Java / Objective-C or another language) and hybrid applications (installed on the device, but encoded in HTML / Javascript and can access some OS features). The type of URL download sounds like a hybrid approach (not quite sure about this), so you can use PhoneGap to create such applications.
  • Hybrid and web applications use the phone’s browser capabilities to control HTML / JavaScript. Now devices are equipped with very powerful browsers based on WebKIt, so a one-page template will work without problems. Although this is a kind of approach to the design of mobile applications.
  • I do not see the need for a local database in your application, you can simply process all the data on the server and access it through RESTful Services by phone.
+2
source

I am developing a mobile application that can be run on mobile devices (with OS such as Android, iOS, WP7 ...). This application will receive data from an online database, then save it in a local database on the device and I can do CRUD with data

Nice!!!

What technology should I use to create a webservice? (RESTful / SOAP ...?)

I’ll go for REST services.

REST has advantages when:

  • You have a set of resources that you want to manage.
  • You want to support navigation between resources.
  • You need scalability.

SOAP has advantages when:

  • You want to publish a description of the web service (using WSDL). WSDL 2 can also describe a RESTful web service. WADL is an alternative to WSDL for RESTful web services.
  • You want to use security, etc. that rely on the use of SOAP headers or some similar mechanism in which data is added and removed from the request.
  • You need improved tool support.
  • You want to check platform compatibility.

What type of return data can be easily processed? (XML / JSON ...?)

I personally switch to XML. This is not a criterion that is easy to handle. About performance in mobile applications. JSON is usually smaller than an XML document, and there for faster work with. JSON can be parsed more efficiently because it can be parsed as JavaScript, which the built-in eval () function will do for you.

How to synchronize between a local database and a database on a host?

Create a service that contains a timer and starts in the background. Start the REST service at intervals to get the latest values. But since this is a survey question, it is inefficient and has less performance. In another approach, PUSH notifications will be used. As soon as any changes occur on the server side, send a push notification to the client (mobile) and, therefore, perform the operations of the local database.

iOS, Android, WP7 ... accept to load an external url in apps?

I did not understand this moment. What do you really want?

Should I use single-page application technology?

Single page technology is very good. But it will depend on your business. If possible, use it. Just create different HTML pages.

I will create an application using a cross-platform structure, and it will work with a local database. I just handle the synchronization between the local database and the host database. Problem: what is the best database and the best foundation for this?

The choice of database will depend on the choice of cross-platform mobile communication platform. Telephone service is exactly what you need. And the database will be sqlite . Phonegap provides an API for storage, so you can easily access the database on another mobile platform.

+2
source

Source: https://habr.com/ru/post/1402072/


All Articles