Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I need to have a trial period (7 days) in my application. From this I came to know that you can do that by keeping permanent file, database or shared preference.
Where do I keep that file so that the user isn't able to see/delete it.
If I put that logic in Sharedpreference or a file with a path "data/data/packagename", when the application is uninstalled then all history will be lost.
Any other workaround/ideas?
Note: there is no server, application works locally with no Internet.
I would say a better workaround would be encrypt your file and then store it in a random place. This way, even if the user has the access to that file, he/she is least likely to tell it's purpose and delete it anyway. And Android has great support for encryption as well.
Have a look at these to get you started:
Android Crypto Implementation
Android Developer: Crypto Package Summary
You can store as hidden so no chance to delete by user
see this
I would say, make the application's data which can't be cleared from manifest like this:
android:manageSpaceActivity="YourStartingActivity"
in application tag.
Now place the application in database or application folder. This solution will save you from clearing application data. Now for uninstallation issue. Make a broad cast receiver which triggers when any application is uninstalled from the device. Once user will try uninstall your application you can catch it through receiver and prevent it. This broadcast receiver can be in a separate class like Watcher class which will be installed with your application.
You can do it easily. There are many examples.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am developing a phone application using Firebase cloud services. The App is publishing new activities with images and captions.
The way I'm thinking is writing activity first into Firestore and then use the Firestore's generated id to name the image in Cloud Storage.
But, The question is. What's the best approach to handle errors if the app was able to write into the Firestore BUT not able in Storage? How is the whole thing will impact the user experience?
Not Sure, If saving the image into the phone filesystem temporary until getting it uploaded the right wat? OR Prompt the user about the failing process? But again this will costly by deleting the activity from Firestore or how to manage it if the user already lost the connectivity for some reason.
There are a lot of items it could happen during this process with a lot of possibilities. What do you think?
Thanks,
There is really no "best practice" here, other than writing the code that meets the needs of your app.
If an operation fails for whatever reason, and you need to revert other operations due to that fail, you will simply have to write code that undoes what you did previously. So, if you created a document in Firestore, then uploaded an image in Cloud Storage, but the upload failed, you will have to decide what you want to do with that document. Maybe you want to delete it, or maybe leave it around to use later. It's up to you - we can't tell you what your app ought to do, but you can write the code that does exactly what you want.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm not very experienced with developing app/tools, but I really want to develop (if practically possible) a tool that would notify the owner of the Google Drive folder of the information related to someone else accessing the folder (assuming that the folder is shared with that someone) such as, Access Date/Time, Accessed By etc. In my opinion, this would only be done if the user/owner has the tool/app opened/switched on.
I was reading the Google Drive API but couldn't find anything useful on this.
I'd like to know how to get started with this project, if this is even possible? I'm not very experienced but I want to learn as I grow.
I recommend going though the Google Drive API. When set up correctly Changes.watch will notify you when ever a file has been changed the trick for you will then be to notify your user.
Alternative would be to just check the file every now and then and see if it had been changed using file.get. However this is probably over kill depending upon how soon after the change you want to know about it.
I am not an android dev so cant help you much more then that. Your question is rather broad so once you start working with it if you have any issues getting it working I recommend you ask a new question directly related to those issues. Welcome to stack
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Hey guys I'm working on an Android App with Android Studio and I need a database like mlab(mongoDB). But Android doesn't support mlab. I can't just use SQLite because my data has to be saved also when my application is not running.
For example if my user signs in, their profile photo and other information should be saved in the database and I also want to code something like a friend request which also should be saved in the database.
I googled so much but I didn't find a good solution.
I hope someone can help me.
You asking about two separate things. mLab is a Database as a Service which uses MongoDB, while SqLite is just a database.
You can save data while your application is not being used with either option, simply look into background Services and other parts of the Android API that allow background tasks.
If you want to save data to a database that is not on the device, you'll need to look into the documentation of the service to determine the best way to interact with your database. In the case of mLab, they allow both custom drivers and a REST API for interacting with your database.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i am developing an app, in which some data is written in a file during a process in the app.
Now what i need to do is to delete that data from that same file during uninstallation and want that same file to be there in the mobile. Can anybody tell me,, is it possible ?
You have no way of knowing this (in short of exploiting some security hole in Android). Just like #FoamyGuy said, this could make an app do a bunch of bad things. There is an intent called ACTION_PACKAGE_REMOVED which is broadcasted when an application is uninstalled. The catch is it is send to all apps except the one being uninstalled.
This is confirmed here in the docs
Now if you are feeling especially nefarious and if you have two of your apps on the users device, then you can listen to the ACTION_PACKAGE_REMOVED intent for each other. But that isnt very feasible and a story for another day.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am looking to find the most efficient way to create an application that has a 30 day trial and then forces the user to buy the full paid version if they like the demo's features.
I was looking for suggestions as the best way to implement a license for the app. Here were some thoughts I had:
-Sharedprefs - This would work until the user uninstalled and reinstalled the app. The trial period would essentially start over.
-Use Device ID - I thought I could get a device serial number and upload the data to a server. Then I came accross http://android-developers.blogspot.com/2011/03/identifying-app-installations.html that showed the issues with trying to get a user id for a device.
UUID- It seemed like this was the best option. However, would someone be able to give me an overview of how to implement this and how it works. Also what are the limitations.
A sample implementation is already presented in the blog that you have cited.
Limitations: For your case, UUID won't work. Since, the user can actually delete whatever file/UUID you use for tracking (not easy, but doable)
Your requirement is to track devices. So, perhaps, go for telephony ID, Mac ID or a combination of both.