Navigate Between Applications At Android
I am having 4 different applications. One is a login and other three are apps that will go to login if not authorized. Login app should get the package name from the other apps. Ac
Solution 1:
I think you need to do following stuff.
App1 :: Authenticate User
App2 :: any app
App3 :: any app
- Design Content Provider for Authorization of Apps. The content provider will be a component of App1.
- Other app will query Content Provider to know whether user of app2/app3 is authorized or not?
- If not then apps will fire an intent as a startActivityForResult for App1 to perform login action on behalf of other apps. We need to send user credentials, package name etc in intent.
- We need to define proper request and response codes for login action i.e in startActivityForResult.
- App1 will store user authentication data against each package(i.e app)
- Here main thing we need to take care of is when should App1 refresh it's user authentication data stored against each package.This mainly depends on your requirements.
You might need to add some more use cases as per you requirements.
Solution 2:
Finally I got to complete it as
1) create a file from every app that goes to login app. The file should contain the package name.
2) intent to login app.
3) authorize with login app and move to package as written in file.
Here I created 2 files one containing authorization i.e username and password and other containing package name.
The second file must be deleted and created every time before writing the package name.
Post a Comment for "Navigate Between Applications At Android"