Android - Setting usage flag - java

I am currently creating an app and would like to create a demo version (free) and a full version.
However, I am wondering how I can set some sort of flag so that when the demo version has been used 5 times, you have to buy the full version to continue using. This usage will be detected on a submit button.
I was considering setting a flag in the app, however releasied that the user could uninstall the app and then re-install it overcoming my set flag (as this would set it back to 0).
Has anyone got any clever solutions for my little dilema?
Thanks

You might want to try one of the techniques in this answer: https://stackoverflow.com/a/996288/1205715

I think that is not possible with an local application.
File saving to sdcard with strange filename can be a way but It is not perfect.
In my opinion, Right way is using an application server that manages user run times with unique UUID.

It might also be worth thinking about an alternative approach.
In app purchases are now available, so you could have a free and a restricted section in your app, and use the in app purchase to unlock the restricted section. You see more developers going with this approach these days, rather than managing two versions of the app.
Also worth considering the fact that if you have a paid version of the app it can be pirated pretty quickly, one person just needs to get their hands on the full apk. However, if you go with the in app purchase model you will be letting google handle a lot of these issues for you.... just a thought, and the road I will be taking with my next app.

Related

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...

How to give your app to certain users free of charge?

I just added an in-app purchase to my app which unlocks extra features and I have a few questions.
I have a friend who helped me a lot in the development process, I want to give him the extra features for free, how would I go about doing that?
I use my own app and since I can not purchase my own IAP, how would I go about unlocking said features without making a custom build for myself?
Thanks everyone!
In the past I have seen developers implement a Coupon Code feature, which allows the user to enter a code within the app that, when gotten correct, will unlock certain features. Implementation of a like feature will allow you to distribute a code to yourself and others to be used to unlock features without payment.
One simple solution to the first problem: send your friend money (cash) equivalent to what they would pay to get your app from the appstore.
Apparently there is no solution to the second problem ... apart from using two distinct Google identities.

Possibly non-intrusive method to change complete android application code with a library

I'm having quite tough problem while developing a testing framework for android apps. The text got a bit long so the actual question is in bold for those that don't want to read the context.
Basically, what I'd like to achieve right now is to trace user activity while he's using the application as one of the features. There's my app that manages context data all the time and developer's app - the one being tested. My idea to do this was to get coordinates where user touched the screen along with taking a screenshot simultaneously. Then I'd use the coordinates to mark the spot on the screenshot to get the idea of what user was doing the whole time with the app. Take hints on user experience and trace crashes.
Non-system apps cannot take a screenshot for security reasons, but application itself can take a screenshot of its Activities without much trouble for non-rooted users, e.g. like here. My only hope here is to interfere with developers' code to implement the functionality of doing so while my testing app is running. Each Activity then would have to extend my overridden Activity instead of regular one, implement an interface, implement broadcast receiver etc.
I am going to write a library for developer who would like his app to be tested with my framework. I'd like it to do the job for me and be as non-intrusive as it's possible for him to use. How to achieve that the best way?
Ideal case would assume linking the library to project with maybe a small addition in manifest that'd get the job done and after just unlinking, removing that bit of xml in manifest for production.
That's an open question. I don't expect any bits of code, but some nifty Java trick, Android OS functionality or even completely other approach that'd solve my problem
I tried to be as clear as possible with the question, but that's a quite tough matter for me to describe so that could have turned out contrary. Don't hesitate to ask me for more details, to speak my mind more clearly or even rewrite the question. Thank you all very much for help!

Android Bug Report

My app is crashing randomly and I dont know why.
I saw that there are apps that when there is a force close, you can choose between force close and report.
How can I add it to my application?
Thank you
Ron
I think the best approach in your case is to have the crashes reported automatically in the background as soon as one occurs.
This is achievable through integrating a product like Instabug.
It offers you a plenty of details regarding every crash including the crash stack trace, all network/console logs, an environment snapshot, and visual reproduction steps.
For full disclosure, I work at Instabug. I'm glad to help if you have any questions.
That will be shown to users automatically when your app is delivered via Android market. Although personally, I ACRA because it gives you more information and you can use it regardless of whether the app is distributed via market or not e.g. for beta testing.
http://code.google.com/p/acra/
My favorite is BugSense. Good user interface, good report details, open source client library or use with ACRA.
http://bugsense.com/
I think that comes automatically when you've uploaded your app to the market.
If one of your users decide to report it instead of choosing force close you should get a report in your admin panel (https://market.android.com/publish/Home) Next to the price of the app in question you should find a link called something like error(X) where X is the number of different error reports sent to you.
You could also look into this:
http://code.google.com/p/android-remote-stacktrace/
It's something you can add to your app that makes it sent the stack trace to your server. I find this one use full sometimes!
//André
Although the question is a little old, I guess it’s useful to refresh the information. ACRA is good, but I would also recommend you to try Crashlytics. It has a very simple interface. Thanks to the simplicity, you can easily install and use this tool. It allows not only making ordinary crash reports but also catching NDK crashes.
Here is a comprehensive review of different helpful bug and crash reporting tools for those who are curious in details: http://cases.azoft.com/report-bugs-effectively-mobile-app-testing-tools/

Maintain pro and free version in Android

I have noticed there is a lot of apps in the market with 2 versions. One free and one paid with extended options and adfree typically.
Im considering make something similar with a project but, whats the best technique for maintain both versions? I suppouse using 2 android projects in eclipse and manually change them is expensive and error-prone
Thanks in advance
Make one version of the app, and use properties that you read from some bundled resource file to determine whether it's the free version or the paid version. For instance, when building the paid version, you just set something like:
com.myapp.version=paid
...and for the free app maybe something like:
com.myapp.version=free
And then as part of your initialization code you could fetch this property from the file/resource, and set it as a system property. And then the rest of you code can just do:
if ("paid".equals(System.getProperty("com.myapp.version"))) {
//allow access to paid functionality
}
else {
//nag the user to get the paid version
}
So instead of two separate projects, you have a single project and a single codebase that you use to build two different artifacts.
You can have a constant value hardcoded in your app, such as boolean isPro. if (this.isPro), you can allow other features or not show adds. Then, when you are ready to upload your apps to the android Market, just create two - one with isPro assigned to false, the other to true.

Categories

Resources