How can I put a lot of data in android application? - android

My question is how can I put a lot of data in android application,or what is the best way to solve my problem ?
I'm building an app that will contain about 43 lessons,every lesson will be accessed through cardview and every lesson will have a lot of text,images and maybe some other things.
Is the best way to solve this to do every lesson manually,or there is another way that I could solve this.
This is how lessons should look like in cardview (similar)
And when i click on cardview needs to display me a lesson.
My problem is only text,image and other things in that lesson.

You need to store all your data in a database and populate your contents in a recycler list. With this you can click on each item to view a particular lesson.
You will eliminate the need to create multiple activities for each lesson.
You will have a small app size
I have a project in github that might help you https://github.com/mbobiosio/SqliteDatabaseAssets and this is the Kotlin version https://github.com/mbobiosio/WordCup18Team

Related

I need help finding a way to create a layout in android

I'm sorry. I'm being very vague on my question, but I'm not sure what to search to accomplish the layout I want to. Here's a sketch of what I'm wanting to do:
Basically, what I'm trying to do is recreate a standard booking app, and I'd like to know how can I recreate the part showing each room. I'd like some help how to create the layout to show 1 room and how to repeat that layout multiple times.
Use ListView or RecyclerView
Here is an example
https://uniqsofts.com/android-tutorials/android-listview-example

Android Data Counter

I want to create a android view that takes in a specific number and fills up a circle depending on that number. Example of view in the following link:
This view is to view how much data has been used by the user. My question would be what would be the best way to do this? How would I make the circle fill its self depending on the data used up everytime the person checks his data usage. Any tips are welcome.
PS: sorry for my bad English.
You could use a circular progressbar to do it and change the progress on change of the data count. You could yuse this library to do it https://github.com/lzyzsd/CircleProgress It has many different designs, so you could choose from them the one, which is best for you :)
Other possibilities you could see in the answers of this SO question How to create circular ProgressBar in android?

how to display image and description from database in Android

hey guys Im starting developing android aplications however this is my problem.
I need to create a list like this:
http://i.imgur.com/TKRr9aE.jpg
as you can see I need the picture, title, description, finally a cursor that leads me to the complete imformation about the selected option.
searching I found tools like linear or table layouts, but Im not sure if that will be the good way to do this.
my database have just that 3 columns: image(path of the picture), name and description
so my question is ¿what will be the best way to display this? Maybe is something really basic, but again... Im starting with android and I love it! is really interesting I need to get in in this world.
Anyway Hope you guys can help me. thx
What you want is a listView here is a good starting point.
http://developer.android.com/guide/topics/ui/layout/listview.html
Now as far as getting the picture included as well you would probably need to create a custom class that extends listView and then make the appropriate changes.
You can use a list view with a custom adapter. The adapter should extend the CursorAdapter class for managing data from database.
http://www.mysamplecode.com/2012/07/android-listview-cursoradapter-sqlite.html

Need To Create A Help component in Android

I am building an Android application and would like to include a help component in it. The Help module would have a structure as shown below :
HELP
FAQs
Features
Placing Orders
Online Ordering
Mobile Application based Ordering
Phone Ordering
Managing my Loyalty Account
Signup
Points Catalog
Loyalty Status Tracking
Points Redemption
Accessing Order History
Purchase History
Insights
Reports
Setting Reminders
Helpline
As far as i could find, there are two ways of doing this kind of structure.
The first way would be to use a Multi-level ListView. The problem with this is that the code is quite complicated and that usually ListViews have equal number of child nodes. For example :- in the above mentioned layout "Features" has several children whereas "FAQs" has none. How would that work in a List View?
The Second Method is to use Buttons for all the first-level options and then create individual activity pages for each of the corresponding children. So the first page called "Help" would have 3 buttons as shown :-
HELP
FAQs
Features
Helpline
Upon clicking any one, a new page would open with either more buttons or some text; depending on what the user clicks.
My question is, which of the above two methods is better suited to my application? If there is another way to do this than the two i've mentioned I'd be happy to hear about that as well. I thank you for your time and patience in helping me.
Or you can use this open source project to create a TreeListView:
https://code.google.com/p/tree-view-list-android/
I can suggest the following structure:
The HELP Activity will contain 3 tabs
FAQ can contain the ListView of questions.
Features can contain the ListView with Section Deviders: Placing Orders, Managing my Loyalty Account etc.
Helpline can contain e.g. text and image.
This structure can be created using Eclipse Activities templates: Tabs or Tabs + Swipe or Swipe Views + Title Strip.

Switch from one page to another

I'm new to Android programming and I'm working on my first application "FunFacts" where
there should be more than 100 cool things to learn about nature, science etc.
My question is: How can I switch from one page to another using two buttons "left" and "right"? which method should I use? I don't think that a horizontal scrollview is the solution.
So if I have 2 different layouts, page one and page two, how can I switch from one to other in my application?
Thank you!
It sounds like you might want a ViewPager. Below is a link to the Android tutorial. This creates a slideshow type effect which sounds like what you're going for. You said you will have different layouts which this will use one layout but you can customize the content and I would think you would want one so it all looks relatively the same
Docs
Update
No, you don't have to create 100 layouts or activities. Just one of each. Following will be a link to a post that explains it a little better. That post explains how it is like a listview in that you add the different pages to your view adapter as you would with a list. You can use the same layout for all and just add new data to it (like a list). Probably store them in an ArrayList or possibly a DB if you have that many and want to have a lot of data attached to them. I hope this makes sense and helps a little. I would suggest starting one with just a couple pages to see how it works, following these examples, and if you get stuck then post a more specific question as to what you can't get to work.
Link

Categories

Resources