Java Question B4A library for database synchronizing

nK0de

New Member
Hello everyone!

I'm creating an app which make use of local SQLite databases. There is a central main MySQL database hosted on a webserver. When I make a change in the main MySQL database, the client apps should check and sync with the main DB at start-up.

I did a lot of research and came across this product named Pervasync, a database synchronization software. And it offers integration with Android apps too! It's written in Java. Although I'm a programmer, my Java knowledge is next to nothing! I come from a .NET background. Nevertheless I have already started writing a B4A wrapper for it. And I have couple of questions.

Here is the code I have written so far.

B4X:
package kodesolutions.b4a.pervasync;

import android.content.Context;
import android.content.Intent;
import android.app.Activity;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import pervasync.*;
import pervasync.ui.android.PervasyncService;
import pervasync.ui.android.PervasyncClientActivity;


@ShortName("Pervasync4b4a")
@Author("nK0de")
@Version(1f)

public class Pervasync4b4a 
{
   public void StartPervasync()
   {
      if(!PervasyncService.isStarted())
      {
         startService(new Intent(this, PervasyncService.class)); 
         //The method startService(Intent) is undefined for the type Pervasync4b4a
      }
   }
}

And I get an error at the startService method. Thee error message is mentioned as a comment in the code above. What am I missing here?

Thank you. And thanks to Erel for this amazing product!
 

chaconproducciones

New Member
Licensed User
Longtime User
Sqlite DB sync with MySql

Hello, I have my locally Sqlite DB on my Android device, I need to sync with a MySql DB that is on a web server, which I make to synchronize user request when needed, Thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…