Android Question Direct access sqlite database from device.

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
sqlitestudio has a plugin that allows you to access SQLite database from device.

(DbAndroid plugin)

The sqlitestudio page says: (adapted)

#AdditionalJar: SQLiteStudioRemote


and add this line in java to code:

SQLiteStudioService.instance().start(this);

and sqlitestudio would be able to access the database directly from the device.

How to run this java in B4A?

SQLiteStudioService.instance().start(this);

Thank you.
 

b4auser1

Well-Known Member
Licensed User
Longtime User
You need to use JavaObject.InitializeState with the full class name.
Do you mean InitializeStatic ?
Something like this:
B4X:
Dim bo As JavaObject
Dim SQLiteStudioService As JavaObject = bo.InitializeStatic("pl.com.salsoft.sqlitestudioremote.SQLiteStudioService")
Dim instance As JavaObject = SQLiteStudioService.RunMethod("instance")
Dim joActivity As JavaObject = Activity
instance.RunMethod("start", Array As Object(joActivity))
 
Last edited:
Upvote 0

b4auser1

Well-Known Member
Licensed User
Longtime User
From the documentation:

The final code should look something like that:
B4X:
// ...
import pl.com.salsoft.sqlitestudioremote.SQLiteStudioService;
public class MainActivity extends ActionBarActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        SQLiteStudioService.instance().start(this);
    }
    @Override
    public void onDestroy() {
        SQLiteStudioService.instance().stop();
        super.onDestroy();
    }
    // ...
}
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I did not have sucess in to make it work.

If anyone is interested in using the plugin and make it work with B4A please tell me how.

SQLitestudio - DbAndroid plugin

Thank you.
 
Upvote 0
Top