How to avoid "Hack" on Parse current user file on Android - java

I'm developing a Social/Messaging app for Android on Android Studio using Parse as the backend.
I think I could have a problem with security, because the app let you buy a premium account using your credit card or coins that you get watching ads, in the activity where you update your profile the app saves the new data (from editText) using ParseUser.getCurrentUser.saveInBackground. Root users could modify the currentUserFile and then when the app updates the data, the modified data get updated
My question: does Parse only updates the new data or updates the whole user Object using saveInBackground ?
Is there a way to only update single data as age, gender, etc?
Thanks!
Edit: Problem solved, see comments below

Related

how to save checkbox state in android

I'm working on an android cooking app (using java) and the homepage has a recycler view populated with recipes which users can like (similar to FaceBook posts). The like button is a checkbox, what is the best way to save the state of the like checkbox for every recipe, so when the user signs out of the app and sign in again they will not like the same recipe more than one time.
Is using SharedPreference a good idea in this situation?
**im using MySql as a database and firebase is not used.
You could definitely do it using SharedPreferences - but I believe this is more ideally designed for 'preferences' of an application rather than 'application' behaviour state.
You might want to have a look at : https://developer.android.com/topic/libraries/architecture/saving-states?authuser=1
Here you will see some options of how to serialize and persist UI states to memory. I have not actually used something like this before - in the past only using SharedPreferences.
You could of course also create your own storage method, or solution but why bother when ones already exist.
Since you are already using a MySQL database, your application is already grabbing the rows from the DB to show them, so why not add another column called 'checked' which is a boolean type. Then when you get your recipes you get the 'checked' variable, and if it is true, then set your UI state of the checkbox to checked, otherwise false :)
The benefit of this approach is that if your app became 'hybrid' and you wanted a website for it too - the data on the database becomes centralised, meaning your persisted user state is the same on mobile as it is web experience, which is a nice benefit!

Saving the values temporarily

I have a survey report app, where the user will fill in the data (text and images) but in case he wrote half the report while doing the survey and closed the app to continue later all the data is lost, I am kind of new to programming, I tried to search for a way to do it and found the SQLite but I am not sure of the answer because I don't want to save the data in the app as the report will be sent by e-mail, so as soon as the data is sent I want all the values to be deleted from the app
Please take a look at this link Data and file storage overview.
You can also use the interface SharedPreferences (Save key-value data).
If you want to save your data in an online Database, take a look at Firebase, especially Firebase Realtime Database.
Hope you have all the info.

Best method to show fixed Listview Data - Arraylist / sqlite / any other

My app contains about 8 activities having different Listview's. As the data shown in each activity is constant (cannot be changed by user), what method should I use to save the listview items ?
Should I make a arraylist, sqlite db, or other method.
As the list may be long I want a easy structured method to add data on my PC then shown it on my app.
*Adding data is updating my app with latest list
If you want to add data later on and have it updated on all user phones, you should make an API with a database behind it, where you can send an HTTP request to retrieve data for each list separately.
This way, you can change list content however you want and it will be the same on all devices and you don't have to store it on the phone (maybe only cache it to reduce load on the API). The only bad side is that you need a server and a domain.
May I suggest some simple backends: Flask(Python) or NodeJS (Javascript).

In-App Billing V3 - Purchase an Object that expires after 3 months - Android

I must implement in an Android App the purchase of an item that expires after 3 months.
I read on the developer guide that I should use "unmanaged" products, but I also read that in V3 Version of the API this object is handle as a managed product.
The question is the following, after the users buy an unmanaged object how can I manage the expiration?
For example when the period will expire, the user can purchase another time the same product if he want?
Are you using an online database for your app?
If true, I think that the best way to do it is generating the end date when item is purchased and saving it in an online database. Then you have to check if end date is not past regularly in your app (for example every time that user start app,...).
This works for me, but in my case app connects regularly to a online database to work.
Other methods, like save end date in local storage can be easy hacked.

What is good way to obtain data for a travel application

I have ran into a small issue with an Android App that I am currently working on.
I have a list of points of interest declared in an XML file. The POI's look like this:
<hotel>
<name>Hotel Atlas</name>
<latitude>45.612079</latitude>
<longitude>25.660756</longitude>
<thumb_url>/hotels/atlas.jpg</thumb_url>
<phone>039999999</phone>
</hotel>
The problem that I have is that there are about 200 points of interest and every time the users access the app the XML is read every time from an online location and that means high volumes of internet traffic. The XML is stored online so I can update it every time I want to add another POI and not force users to update the app. Is there any way to send this data to the app and not require to download the entire XML?
I have not yet found an optimum sollution for this and decided to ask for some opinions.
Thanks, Vlad
There are only 2 possible ways:
Either give static database with all POI or
Load data from web whenever required.
Now you can do one thing, keep static database with App. Make web call once app starts and check for the updated data if any changes you made in server database. If there is any change on server database, then update only those data to the local(static) database.
For implementing above step, you must have to pass Last Updated date to/from server. I mean whenever you make web call, you need to pass last updated date from the client, server will check for new data to be updated post this date. Server will store client date as updated date and return back to client.
Maybe it's possible to store POIs like "One POI - One file"? In this case you can easily read only new points from server

Categories

Resources