0

I am trying to connect my android app to another app. So far I am able to detect that if the app I want is installed or not on phone, if its installed, I can open that app.

I need help with connecting that account to my app.(To connect, I need to ask permission to connect account) Any help would be really helpful, thank you.

İmage:like this

buckyass
  • 1
  • 1
  • 3
  • @a_local_nobody no its possible actually, i have seen other apps that doing it. Basically i just want to connect an account in my app. – buckyass Feb 18 '21 at 12:22
  • @a_local_nobody oh i am so sorry, i am not a native speaker so my question might be not clear but i added an image maybe you can understand it better now? – buckyass Feb 18 '21 at 14:31
  • @a_local_nobody thank you so much, it is more clear now right? – buckyass Feb 18 '21 at 14:35

1 Answers1

0

you can do that like this:

try {
    startActivity(getPackageManager().getLaunchIntentForPackage(targetAppPackageName))
} catch (e: NameNotFoundException) {
    // target app is not installed
}

you can find the package name of the application you want to open easily, just search the app in the google play website , and then you will take the id parameter ( it is the package name of the app) . Example : you will search on Youtube app on google play , and you will find it in this url :

https://play.google.com/store/apps/details?id=com.google.android.youtube&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5nb29nbGUuYW5kcm9pZC55b3V0dWJlIl0.

the package name is the id param, so it is : com.google.android.youtube

or

you can find the package name of the target app in Apps section of settings in an android device.

Hamid Sj
  • 983
  • 7
  • 19
  • thanks for the answer, i can open an app from my app but i need to send a request like image i added (i edited my question) – buckyass Feb 18 '21 at 14:29