Saving data to use in multiple activities [closed] - java

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 want to create an app that starts up and has five EditText boxes to input five lessons. I then want to save these 5 EditText boxes in one place to then access from all activities when needed, eg. for setting TextViews. How would I create this single set of the five strings, would they be saved in their own class?

There are a few ways you can achieve that, some of which are:
Use SharedPrefrences
Use Sqlite database - a bit more complex solution.
Extend the application class which is available to all activities.

Related

How do i permanently save a value in an app(android studio) [closed]

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 2 years ago.
Improve this question
I want to save an a value for example my full name(something that never changes and i will re-use it again all the time).I would like it to save it locally i guess.
String str = "abc";
Toast.makeText(getActivity(), "This is my Toast message!" + str ,Toast.LENGTH_LONG).show();
If you want to save small amount of data, like key-value pairs, eg. Name=somename, uimode=dark etc., then you can use Shared Preferences. If you want to save huge amount of data, then you must save it in database (SQLite or other one)

ListPreference & SwitchPreference doesn't work [closed]

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 5 years ago.
Improve this question
I have reverse engineered an app (Settings.apk)
all i want to do is,
I want to make a SwitchPreference, on my case that i wanted to create a switch selector that will turn off / turn on double tap to wake for my device (i added it because that feature was absent, but anyway my device supports the feature)
here is my xml, i created the SwitchPreference on the accesibilty section of Settings app
here
I also created a ListPreference in the xml, i want to create a list selector that was in purpose of choosing the CPU freq & I/O Scheduler. I have also done doing it but it doesn't work as it intended to be.
the ListPreference's xml code is also on accesibility xml . What should i add to make both of them functional?
notice me if my question was offtop,
thank you.

I would like to make an invice in java using netbeans 8 [closed]

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
My question is this that i want to make an invice or we can say bill for our customer , so that now i want to make an invice that has a special style it mean customer logos,address
like this and then i want to print it directly by printer devices so plz can anyone help me .
I use netbeas 8 IDE .
You could create a report, using iReport, and send data to fill it. All data can be organized in a model report, like images, grid (sub-report) with monetary values, bar-codes, etc...
http://community.jaspersoft.com/wiki/ireport-designer-tutorials-help

What is the best way to create a data table in android? [closed]

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 7 years ago.
Improve this question
I would like to create a table which is filled by data from DB. I know that it is possible to create a dynamic table using TableLayout but I'm not sure that it's the best solution im my case.
Here is an example of what I want to create(the first table on the page).
I'll give you my inputs on this.
If your data is limited and you are sure to display all of it in a single screen in a presentable manner, then yes, a TableLayout will suffice.
However, in a real world, flexibility counts so you should always consider the possibility that your data may expand in the future. Keeping that in mind, you should use a ListView or a RecyclerView in this case. Define a base layout for each row of your list or recycler view and then connect the data from your database to this view using a suitable adapter.
For starters:
https://developer.android.com/training/material/lists-cards.html

Search by name and number both within in single search bar [closed]

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 8 years ago.
Improve this question
I want to implement a functionality in java where I can search by both by username or by employee number within a single search bar.
I am looking for a simple solution either at client side or at java side
Thanks in advance
Just perform the first search, if it gives a result use it. If not then do the second search.
If usernames must contain alphabetic characters and employee numbers cannot contain them then you could look at the contents of the string and decide which search to run based on that.

Categories