Access to data on Bubble through native Android App

Hi,

I’m relatively new to Bubble and trying to access the data in my bubble database through an
Android app.
The Android app is developed native using Android Studios.
What I wanna do is this:
Enter username and password into my app, check if the user exists and the entered password is correct. If yes, forward to bubble.

What I have until now: My Website (dev, not live!), few users in the database and my Android App.

What I know need is: How can I connect my Android app with the database?
Do I need to generate the API? How to work with JSON Web Token?

Until now, I always accessed to web data through:
String url = “some url”;

But this time, it doesn’t work.
Maybe this is a silly question, but I would be really happy if someone could help me.
And I have to stay in development mode.

1 Like

I recommend you an hybrid native app using a webviewer.

If you do a good mobile design will look very good.

Generally i dont recommend to anyone try to build a full native app until Bubble bring us a way to handle this.

Its on their roadmap, so maybe soon :slight_smile:

1 Like

While I’ve never done it, I heard that bubble workflows can transfer to Dropsource to create a nice native app environment.

I’d look into that rather than just wrapping the page.

DM

1 Like

So, thank you for your fast reply.
But I have to stay native Android, since I have to access the data from an already existing app.
Isn’t there a way to only read data from bubble?

Yeah, your Bubble can expose a REST API that lets you grab data from it and populate the mobile app. There’s a decent amount of content in the documentation about the API, have you checked there?

1 Like

Thanks a lot @andrewgassen! I didn’t check the manual only the docs.
But I still have open questions about creating the endpoint.

I want the user to log in his username and password and then get his phone number etc. back.
I tried to define a checkuser workflow (see screenshots).
So, I want to post the username within the request (already done) and retrieve the phone number of this user.

How can I define the API workflow?

To connect your Android app to the Bubble database:

  1. Enable API in Bubble:
  • Go to your Bubble app’s settings and enable the Data API and Workflow API.
  • Create an API key for security.
  1. Create a Bubble Endpoint:
  • Set up a new API Workflow to check the username and password (e.g., check_user endpoint).
  1. Send Request from Android App:
  • Use libraries like Retrofit or Volley to send a POST request to the Bubble API with the username and password.
  1. JWT Authentication:
  • After login, Bubble can generate a JWT token which your Android app will use for future requests.
  1. Parse JSON Response:
  • Handle the response (e.g., check if the login is successful) and store the JWT token for future use.