• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Broadcast Receiver vs Main Activity

Hi everyone! _o/

I'm a little bit confused about how BroadcastReceiver works. I'm using it because i want to do some download tracking of my app.

So, my first question is: Everytime that someone downloads my app will the playstore send an intent to my application and my BroadcastReceiver class will be called and deal with that intent or it doesn't work that way? Will only have intent only if the playstore url have more parameters?

If the first is true, then i will only call my TrackDownload function in my BroadcastReceiver class. If not where should i call it? In my Main Activity? Be aware that i want to track all the downloads.

But if i have to call my method in other class, ie: Main Activity, what is called first? The Broadcast Receiver or the Main Actvity?

Will the BroadcastReceiver work in background even before the user opens the app for the first time?

I'm not sure how to do this..
Are you used to deal with app tracking?

Many thanks,
Filipa
 
If you're talking about part of your app running when someone downloads it, no. It has to be downloaded and installed before any part of it can run. Your app can't track itself being downloaded from Play.
 
Sure!

But if you send an intent from playstore, the user download and install.
Then, what runs first? The Broadcast Receiver or my Main Activity?
Or will my Broadcast Receiver run right after the the app finished intalling?
 
Back
Top Bottom