How to "flag" users in firebase? - android

I have developed an android "Group Chat" app. Me and 20 of my friends are using this app to group chat with each other. When I look at the firebase database, I obviously see 21 users (including myself). However, I can't know whether all of them actually have the app installed on their phones, or some of them have uninstalled it. Is there any way I can differentiate among my uses? Generally speaking, can I "flag" my users as, say, active, inactive, and the like?

What is if you add a timestamp every time a use log in. With this timestamp you can see how long the user not log in and so if he is in active for a long time or not. It's not say if the user have delete the app. It's only a prognosis.

If i understand correctly your question, it can be split in two parts.
First part is whether you want to know if your users are online or offline this could be achieved by an online presence system as described here
The second part is whether or not users have installed or uninstalled your app.
In my opinion easiest way to do this is by using the Firebase Analytics SDK. This way you can check the app_remove stats and whenever a user uninstalls an app, it gets updated in the console under events section.
This will give you how many devices uninstalled the app and some info on country, gender and age of the user but you could couple this with a "last login" timestamp to pinpoint the exact user.
More details along with how to include analytics SDK to your app can be found here
Or you can use the .info/connected to have this functionality in your client code. You can read more info about this here and the sample presence app at the bottom of the page will help you get a grip on how to do it.

One possible solution is to add a flag in the database as the child of the user. This flag will have an initial value of active.
And instead of uninstalling the app directly, you can have a delete account functionality in the app, and whenever someone wants to delete his/her account, it simply updates the flag to inactive in firebase database.
Now you will know actually who is active / inactive.

Related

How can an age restriction be applied to an Android app?

I'm working on an Android app where a user must be 18 years or older to apply.
If there will be people under 18, the app would have negative public view which I do not want to deal with.
Is it somehow possible to be sure that my users are older than 17? Is there any service which could possibly accomplish this?
Ideal fictional solution: in my registration form the user writes his/her id number and I would check if he/she is old enough with fictional service.
One not very good solution which I found. There is an app called Muzmatch. It is dating app for Arabs. When the user register he have to use device camera to take picture of himself and send it to server.
I can do the same in my app and check if the user seems old enough but I think it's stupid idea.
Yes this is possible through the Google Play content rating system.
Check out the link: https://support.google.com/googleplay/android-developer/answer/188189?hl=en-GB
Scroll down to the Take your app’s rating questionnaire section and it'll run you through the steps to apply an age rating to your app.
In addition to this, maybe you could create a free in app purchase, that the user will have to buy when first entering the app. They would then need either a password or finger print in order to pay via Google Play.

How to get information about the end user who uninstalled my application

Is it possible to know get information about the user who uninstalled my application as google console shows only the stats about the total number of uninstalls and installs,but in my case i want to know who uninstalled my application any suggestions appreciated.
Note : I do have all user email id who installed my application.
it is not possible to know who removed your app.
As per my knowledge it is not possible to track the uninstalled user records from our end.we can get that uninstalled user data only from Google console.
Suggestion : It is better to maintain a active and inactive users list to estimate approximate active users for your app.
Maintain a flag on your dashboard in any server call to know the last date and time of usage of your app for every respective user.If he was not used for more than 3 months for example just mark him as in-active user.

List of Installed App From Google Play Against Google Account

Following are my problems:-
Is it possible to get the list of applications that a user has installed, against their google account through Google Play, programmatically through the use of any api?. Please note that I am not asking about the list of apps currently installed in the device, but ones that have at some point been installed.
I need a solution to the above as I am thinking of a scenario in my app, which is:
I want to give my app to the user for free during the first three months, after three months if user uninstalls the app and then installs it again I want to detect through any api (from Google Play) that the user has installed the app a second time (and should not get any free usage). Please note that I don't want to use any web service to store the account id & device id of the user at my side.
For option 2, you can create a file on the SD card. This will remain there when the user uninstalls/installs. But the user can always delete your special file. Unless you do something at your side, you are never sure if the user already used your app before.
To be completely sure, store it online:
You will need to have a very simple database which holds a list of device_id that installed your app.
Further more a webpage which fills this database.
In your app you download/open this webpage which the webpage will fill the DB.
App > WebClient (or other) which opens http://www.example.com/registerDevice.php?device_id=. The php site fills the db.
You app will need to check the database if the current device already has installed this app inorder to work/not work. You can do this via the same php and check the response. You could for example return 'ok' or 'not ok' or something else.
The simplest method is to get the account of the user the first time he/she runs the app, and send that detail over to you.
How this is can be done is well-documented over here: How to get the Android device's primary e-mail address
You will have to add another line of code to check back to the database at the first start of the app.
EDIT: For a non-web solution, simply add a timer to the start of your app:
schedule(TimerTask task, Date when)
the task should be adding a token AFTER the period of time you wish to give, to the phone's memory with the user's account details for authentication (see first solution on getting the account details)
Finally, as above, add a check-back to the phone's memory for that particular file to see if the user has used the app before.
The problem with any type of authentication that is based on the phone's memory is that people can easily remove the token, if they can find it, and reuse the app again.
Try this device specific implementation:
PackageManager packageManager = getContext().getPackageManager();
List<ApplicationInfo> applications = packageManager.getInstalledApplications(
PackageManger.GET_UNINSTALLED_PACKAGES);
// retrieves some information about all applications (even uninstalled ones)
// which have data directories
Of course this method won't work if user replaces the device. But you don't need to use any web service.
You can use this by keeping a database of hashed device id and users google id on a 3rd party server.
Also see http://android-developers.blogspot.de/2011/03/identifying-app-installations.html

Disable single user

Hiho,
is there a solution to disable my App for one single user?
There is one Person, who buys my app every few days to use the app for calculations, and than deinstalls the app within the 15 Minuts window.
Over 10 times he did it and with the next update i want to create a method, that checks the user mail from market and if its these person, the App should close instantly.
Thanks for Help
Alex
Are you sure this is the same user (and not just a usage trend of one refund every few days)? A user should only be able to refund an app once. According to the App Refund article in Android Market Support:
You have 15 minutes from the time of download to return an application purchased through Android Market for a full refund. You may only return a given application once; if you subsequently purchase the same app again, you may not return it a second time.
EDIT: If it looks like it's the same user, please contact Android Market Support and let them know. Follow the relevant "Contact Us" link at the bottom, and include all relevant information: App name, user's email address, order ID's, etc. Abusing the refund policy like this shouldn't be possible. If it is, they need to know so that hole can be closed :)
you can get the accounts from accountmanager, as I know to do what you want, checking account is the only way I think. you will need GET_ACCOUNTS permission.
Instead of putting in hate code for this single user, I'd suggest you put in a little more effort and put in a more generic check.
Whenever a user signs up, check if the user has already used your application, and if he/she has not, save the user's account information on a backend. Else notify him saying that he/she has already checked the application out and if he/she has some feedback. Try to make the user 'guilty' here!
Building a backend system is pretty simple with a service like stackmob.com. Though for this, you'll need to acquire the GET_ACCOUNTS permission, and for a service like calculator, asking for this permission might seem fishy. So you need to make that call here!
If you do figure out how to identify your user rather than close right away you should do stuff that delays them for 15 minutes.
Make them fill out some forms first (Just for that user), stuff that takes time. Be really specific in the forms with password requirements like 10 chars including upper, lower number and punctuation, then force them to "Log in" using this password (which they won't remember and will have to start over...), but always make it look like each step is the "Last little bit" they will have to do before they can use the app...
Also use a lot of "Contacting server..." and "Calculating" and "Installing" that take time. If you really need to stretch it out, add a few "Retrying" after the connecting message has been there for a while.

Is it possible to get infomation such as how long your application has been installed and user demographic

I am implementing Google analytic into my android app and I have got all the page views, click event analytic's I want.
I am now wanting to know how long the user has had my app installed for and if possible their demographic such as age and sex (note, my application dosnt ask the user for this information so I assume its not possible).
Also is there any other useful information I can collect which is generic between all apps and how do I do this?
Like you said, if you are not asking for this information then it is difficult to obtain.
Here's a post that talks about recognizing when the app is installed for the first time. So when this happens, you could make a call to GA or save the time/date to a remote database.
Is there on install event in android?

Categories

Resources