This question already has answers here:
What to do when you need to store a (very) large number?
(4 answers)
Java equivalent of unsigned long long?
(10 answers)
Closed 7 years ago.
I wan to create a funny incremental game in java but I don't know how to store data. I thought use a long but I'm not sure that it will be enough.
I know that big integer could works but I'm not sure thaht it's really efficient.
You might want to use long or BigInteger class, depending on how big number you want.
Check out this question/answer for a valid solution!
What to do when you need to store a (very) large number?
Related
This question already has answers here:
UTF-8 all the way through
(13 answers)
Closed 6 years ago.
I'm building a chat application in which I'll be using emoticons, so the problem is that when I enter and send the text, for eg. -
"Hahha this is so funny 😂"
In MySQL, it gets saved as "Hahha this is so funny ??"
Can anyone tell me how to detect whether the string being saved to server contains an emoji and if it does, then accordingly convert the emoji part to special unicode format?
Thanks a ton!
Use a library like this to decode the text first.
I have't tried it myself but from what I see, it is possible.
https://android-arsenal.com/details/1/1806
This question already has answers here:
Adding an assets folder in Android Studio
(5 answers)
Closed 6 years ago.
I am developing a Quiz application. I need to store the questions and answers(options) some where in the app so that I can fill the TextView's RadioButton's in a Activity Dynamically. How can I store such data and Access it to fill my Activity.
I am not sure about the concept. Please suggest the best way to do this.
you can use shared preferences to save local data, to check it in file folders manner you can use DDMS. You can also use SQLite.
This question already has answers here:
What does the SQL Standard say about usage of backtick(`)?
(2 answers)
Closed 7 years ago.
I'm new to SQL.
In fact, I just started to use SQLite for Android.
I saw some SQLite examples and found some people using "" and [].
I tested those in my code and now I'm guessing they are just the same as ``.
1. Am I right?
2. If so, those are standard? I mean, can I use them in MySQL or Oracle too?
I also tried "" instead of '' for column data and worked fine.
3. Can I use double quotation marks for this use case? And standard?
The SQL standard to encapsulate strings is '', on ALL RDBMS platforms.
[ and ] are used to escape spaces in columns (or indexes) or table (or view) names.
This question already has answers here:
How to sync SQLite database on Android phone with MySQL database on server?
(5 answers)
Closed 9 years ago.
I am new to using services. In my application I want to run services in the background. I am creating the same database in MySQL server and SQLite. If I change some data in a table in the SQLite database, does it mean it should automatically store the change in the MySQL-server also?
To answer your question: no, it does not automatically reflect the changes made in SQLite into MySQL.
Why? Because you basically have 2 different databases, although they have the same name (and probably structure). In order for them to communicate and get synchronized, you need to implement some kind of communicating mechanism.
As suggested to you by eggyal in an above comment, take a look here, as a solution for this kind of problem is explained there.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Android pre-filled DB
I want to use SQLite as a static data. By that I mean to preload it with data before application first start. This data is static = no inserts, deletes or updates. I just want to use full power of sql database queries and indexes. Because my SQLite database should have a lot a lot of data I don't want to upset users with long initial loading time.
Is there any way to do it (preloaded, predefined, preinserted database)?
No, sadly this is not possible. A workaround is to copy the database over to the application data or to the SD card (if available) and load it from there, but IMHO this is an ugly solution.
Have you thought about using Java data structures for this data? It should be much faster to preload. If you do not want to use plain Java structures, I would recommend to use JSON or protobuf - whatever works best for you. :-)