Android Question App based on another

mcqueccu

Expert
Licensed User
Longtime User
I have an app lets call it AppA, and it hass 5 products on subscription.
And user has to create account and login to access the products they are subscribed to.

Now I want to separate one of the products into its own App, lets Say Product 3.
But I dont want the user to register or login again in the new product3 only App

is it possible for the New App to
1. Check existence of the Main App (AppA) - I will use PackageManager✅
2. Check if user subscribed to product 3 from the main app, then grant access to the user?

How can I achieve this?
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
Based on the limited information, you could perhaps group those 5 programs as 5 B4XPages. You can read and write a JSON file to a folder depending on whether the user is authorized. With that information, you can allow a menu option to select or not select that program (B4XPageX). Numerous variations are possible based on this basic principle, which you are best placed to judge.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
I have an app lets call it AppA, and it hass 5 products on subscription.
And user has to create account and login to access the products they are subscribed to.

Now I want to separate one of the products into its own App, lets Say Product 3.
But I dont want the user to register or login again in the new product3 only App

is it possible for the New App to
1. Check existence of the Main App (AppA) - I will use PackageManager✅
2. Check if user subscribed to product 3 from the main app, then grant access to the user?

How can I achieve this?

You will need a backend with database for it and also login with gmail in both apps. That is how I would do this.
 
Upvote 0

mcqueccu

Expert
Licensed User
Longtime User
You will need a backend with database for it and also login with gmail in both apps. That is how I would do this.
I want to prevent ANOTHER login from the second app. I want the second app, to in a way find some bits of pieces of information from FirstApp (which user already log on) and subscribed to access second app without another login.

Copilot gave me this


Yesterday

I have an app lets call it AppA, and it hass 5 products on subscription. And user has to create account or login to access the products they are subscribed to. Now I want to separate one of the products into its own App, lets Say Product 3. But I dont want the user to register or login again. is it possible for the New App to 1. Check existence of the Main App (AppA) on users phone 2. Check if user subscribed to product 3 from the main app, then grant access to the user? using b4x

Mark, this is a classic cross‑app authentication and entitlement problem. On Android (and therefore in B4X), apps are sandboxed: AppB cannot directly read AppA’s private data (like SQLite or SharedPreferences). So the flow you want — “detect AppA, check subscription, grant access” — requires a deliberate communication channel. Let’s break it down:

✅ Step 2: Share subscription state​

Here’s where sandboxing blocks you. You have three realistic options:

1. Backend‑based SSO (Best Practice)

  • Both apps talk to the same server.
  • AppA stores the user’s subscription state (Product 3).
  • AppB queries the backend with the same account → backend confirms entitlement.
  • No local data sharing needed, Play Store‑friendly.

2. ContentProvider in AppA

  • AppA exposes a ContentProvider that returns subscription info.
  • AppB queries it with JavaObject.
  • Example: AppB asks content://com.yourcompany.appa/subscriptions/product3.
  • You control permissions (AppB must be allowed).
  • This is the only safe local way to share structured data.

3. Custom Intent / Deep Link

  • AppB sends an intent to AppA: “Give me Product 3 status.”
  • AppA responds with a result (token or flag).
  • Requires both apps to agree on the protocol.
 
Upvote 0
Top