How do they implement reward system in apps/games? - java

If you noticed, there are more and more apps which are free, but in there they have some kind of currency (gold, fake money, etc.) which you can either buy or earn for free. I am interested in this free earn system.
Namely, you get a popup like "Download and start app XY and you'll earn 5 gold coins". So I download the app and runs it once, then I switch back to app and I immediately receive 5 gold points.
Is there some rewarding system they use or each implements its own?
If they implement their own, how do they check if XY app has been installed ans started?
The way I see it, if I am to implement this on my own, then I contact the owner of XY app and ask him to implement a sample code in the splash of his app/game. When his app is started it send OK flag to my online database. Another service immediately pushes notification to my app and the app know that some user installed and started XY app. But I do not know what should I do in case there is no internet connection during first-launch of XY app?

You don't need an Internet connection; you can just check the list of installed applications, as described here.

Have you tried Scoreloop ? They have a framework which can be integrated into your Android application which will allow you to buy coins, earn trophies, etc, etc....
In addition, they can (for a charge) promote your application with other scoreloop users..

Related

Click on an x and y position in another android application

I have a Bluetooth led bulb that will only work with one specific app. I want to create an app that will open the bulb app (iHomentLight) and gradually increase the brightness slider to wake me up in the morning. I want to know if it is possible to do this, and if so how?
Apps are sandboxed so that someone can't use this kind of thing to take advantage of you (and steal your bank info for example). Some apps work around this via accessibility service.
How to perform Other app list item click using accessibility service like Voice Access app?
However, you are probably better off just figuring out what the bluetooth API for your bulb is and teaching your app to work with it. You'll have your app connect directly to the bulb and do it yourself. Search Google for the bulb name and see if anyone has reverse-engineered the API.
Here is an amazing writeup on how to reverse engineer a bluetooth API:
https://medium.com/#urish/reverse-engineering-a-bluetooth-lightbulb-56580fcb7546
Spend some time trying this out, I think it'll be a more useful skill than messing with the accessibility service.
There are around three approaches you can take:
1 - If you have access to iHomentLight's API, you could potentially send a series of intents to the app and have it gradually adjust the light over time.
2 - If that is elusive, I'd recommend trying to sending touch commands via the terminal. For example 'input tap x y android'.
How to run terminal command in Android application?
3 - Or you can use Tasker App to make commands that will adjust the light just as well

Getting user behavior on the Android Phone (App History, Browse History etc)

Is it possible to get the user behavior on the phone (for example Alpesh has an Android phone and he uses multiple apps, browser YouTube etc). Whatever he is doing on the phone I want to get all those things from behind (which apps he has installed, which app he opens and what he search on the phone, All these data I want to get programmatically so what all can be get in android).
For now I am aware that installed apps list can be get easily but I want to get usage history and what he do all on mobile.
This is not a code solution, but an answer to your question, so you can get start some where.
In my opinion your question title are asking about two things.
(part 1) Getting User Behavior on the Android Phone (part 2)(App History, Browse
History etc)
1- First part Getting User Behavior on the Android Phone:
There is a concept called context awareness. Short described; it is about gathering different information from the phone, like light sensor, motion sensor, sound, location or even user behavior etc. and depending on your app requirement and the gathered information:
You could send these information over cloud data store for statically usage
You could make your phone doing (behavior) different things depending on location, motion or what ever.
etc.
For context awareness it is an open area for pervasive computing research. And it is not just few lines of code to write, it is typically a complete solution depending on requirement. Example I have built a context awareness application to gather noise collected by phones from different locations for research purpose inspired from this framework, but I am pretty sure you can find other frameworks or even build your own, as I did in my case.
The mentioned framework has some examples.
2- The second part is about App History, Browse History etc.:
This is possible, but you still need to build a peace of software (App) to collect all these information (logs) from the phone. Hereafter you can make phone act on different conditions and/or again send it over a RESTful API over cloud service data store, there is no limit for it.
The problem is, there is no thing out of the box for your requirement. Even if you find frameworks you still need to research it and further work on it.
You can find different examples for your requirement, like to collect browser history, you can find SO question here:
Get browser history and search result in android
Or get list of installed application:
How to get a list of installed android applications and pick one to run
My point here is you need to solve small goals at a time and put your knowledge together at the end.
Both 1 and 2 can also be related to each other, depending on your achievement.
Conclusion
Make a goal to your project.
Define the main requirements and tasks of your project.
Research your options (Technology, Cost, Target Audience, What data I can or I should not collect, what is possible to collect, what is the limits, Privacy issues etc.).
Split your project in small assets and try to solve small problems/goals.
Finally you would be able to put the puzzles together and build your final application
but i want to get usage history and what he do all on mobile
This is not possible and shouldn't ever be possible. Each app is sandboxed by Android so apps cannot inspect what other apps are doing. Think about it, you wouldn't want apps to be able to intercept private information such as banking details.
Every app is isolated from the other ones. Unless you develop a system signed app, you will not be able to gather all that data.
What you could do is to develop your own Android Rom where you then develop your data collection the exact way you want. Then you need to distribute your rom, which is another story...

libGDX unlockables management and gdx-pay\Native Android\IOS payments

I want to implement unlockable characters that can be purchased and I have a few questions about the best way to implement this in my game.
Currently I manage unlockables by storing them as preferences. However I'm now in the process of making them purchasable.
Is gdx-pay the best way to do this or create a native Android\iOS
implementation?
Once a method of purchasing characters has been implemented and the
user purchases one, what happens when the user uninstals my game?
i.e. should I reverify purchases on startup? This will require an
network connection, if the user doesn't have one it doesn't restore?
Should I be using preferences to store unlocked characters etc or
another method? My reason behind this method was to avoid having
ship a database with it and having to create separate sqLite
implementations for each platform.
Any advice would be much appreciated.
Point 1. Yes, for now if you want to go cross platform then gdx-pay is your choice. Recently they've also added support for IOS 9 which is great. You will be able to deploy on both Android and IOS with minimal change of code.
Point 2. You should always call requestPurchaseRestore in your splashScreen or somewhere on startUp to restore any purchases. This will ensure that even if the user uninstalls the game and installs it on another mobile device they will still have the purchases they've made. Of course, network connection is vital. If you don't have network access and you call requestPurchaseRestore you will get an error. That's why you should have a method to check if the user has access to the internet (wi-fi or mobile enabled) and only then call requestPurchaseRestore. If the user doesn't have internet they won't be able to restore Purchases. I don't see a problem with that. You can put a label somewhere that you need internet to restore purchases.
Point 3. Yes, having a local preferences file is a good idea. This is what I do myself. If an item is purchased you simply store it in the file. You may well use a db too but it's too much hassle for this kind of job.

Libgdx and server game

I wish to create a multiplayer card game but with a server side.
I develop on Libgdx (android) for visual.
I succes to connect my application with Google Play Service because i think i can use the google play account for create the information i need for my game in the server. Like number of victory, number of defeat...
I 'm really confused because I feel wrong. Should I continue with google or create my own login and create an account on my server directly with socket ?
Thank you very much
(and sorry for my english)
You should, if you can, take advantage of the Google Play infrastructure for tracking the state of your game server. It should solve a lot of problems for you (especially identifying users reliably) vs rolling your own infrastructure.
One downside of the Google Play infrastructure is that it only works on Android devices (so if your Libgdx app also runs on other platforms, those will need a different solution).
Google Play infrastructure also assumes that your Android clients can talk to each other and can push simple state (like win/loss values and saved game state) to the Google servers or between each other. I don't think there is any support for running real server-side code with Google Play infrastructure (though you may be able to leverage the sign-on, at least).
Have you seen the Libgdx documentation and code tutorials here: https://github.com/libgdx/libgdx/wiki/Google-Play-Game-Services-in-LibGDX

Can developer keep track of stats of app? - Android

I have made a trivia game app. Is there any way to keep track of, without the user knowing, stats like the following:
How many times a user has played a certain quiz
Overall correct percentage of questions of each quiz and of all quizzes combined
How many times the user ran out of time on a question
etc etc
I would love to be able to keep track of this so I can monitor data constantly to see, for example, if more time is needed on questions because they keep running out of time, etc etc. Right now I don't need a server or any internet interaction to play this game so if that is needed to do what I am asking above, please say that.
You should take a look at Google Analytics for Android. Internet connection will be necesary.
You could do this in a number of ways, all using web services though. It's up to you whether you want to store the statistics on the phone and then send these, or just send each individual statistic on game completion.
You would need a server to act as the web service endpoint which would then be called (using SOAP/REST probably) from the phone either nightly (if you stored the stats on a localdb on the phone) or after each game.
I'd recommend nightly or intervals rather than clogging up the phone owners bandwidth sending stats :)

Categories

Resources