Design recommendation for an android app - android

I am planning to develop an android app. This will be my first app if I upload it.
I have pretty good idea , what my app should do , But I lack design skills and have no one to ask around. So asking android experts here.
App objective : very simple , have a listview with proper titles , on clicking it(list items) , it will show an appropriate image.
Approaches which I thought.
Have a relation between title(or a tag) and image names and have all images in drawable folder. whenever list item is clicked, point to appropriate drawable and show it.
Pros: easy to do it.
Cons: Seems like not scalable.
Store id,title,drawable reference( drawable ids ) in database and use it.
Pros: (different approach than prev one)
Cons: Creating database is painful if number of items are more !
I want some guidance in this approach, how people create huge database(for android) which
works offline.
Have a server, database there , provide an API for my app , whenever update is pressed ,
local database is synced !
Pros: Seems like scalable approach.
Cons: Hell lot of work for a simple app !
Should one consider storing images in database as BLOB data ?
Or none of these approach is correct.
Any advice will be helpful.

How many images are we talking about? Is this set of images static? If so, I'd go with the first option. Especially if these images are small in size.
If you have to modify the set of images (add/remove images from it somehow), and/or the images are huge I'd use the SD card solution too.

I would go with first option with storing the images on the SD card in a folder.

Related

How to use an asset in Android Ui?

I am new to Android Studio. While working on front end its sometimes easy to take some parts as png file and place it on the particular position instead of recreating it in xml file. I am confused can we use png all the time ? I am worried about memory space . Like the app contains 50 pages and in each page I use 1-2 assets . I don't want my app to have more than 40mb. What will be the best way to do? Can we store the image as a URL and retrieve it whenever we use. What's the drawback in that way?
So many questions :)
I am confused can we use png all the time ?
Use what's best for your picture. For a photo, a JPEG will probably do better. But if you wish, you can use PNG all the time, yes.
I don't want my app to have more than 40mb.
Check and see. Depends on how big your images are; we can't tell.
What will be the best way to do?
Not enough information to tell you that. In general, there's nothing wrong with using images in assets.
Can we store the image as a URL and retrieve it whenever we use.
Yes.
What's the drawback in that way?
You'll need to get some server space somewhere. Also, there will be a loading latency. Also, your app won't be usable while disconnected from the Internet.
While working on front end its sometimes easy to take some parts as png file and place it on the particular position instead of recreating it in xml file.
That's the part that is confusing to me. Android XML layouts usually contain interactive elements, ones that the user can interact with. Images, on the other hand, tend to be static. What kind of XML is there out there that you think you can replace by an image?

Android: how to supply thousands of pre saved images with a new app?

I am new to Android development and trying to develop an app with information on collectibles.
In short: the app contains information on thousands of collectible items, each with its own information and properties.
For this I want to set up a pre filled SQLITE database containing all the information. However each item also has an image connected to it.
The app will contain a listview showing all the items of a certain category (max 2k items per category).
Each listview item will have some basic information like Title, Short description and a thumbnail.
The problem is now, that I don't know which is the correct way to handle the images. Searching the internet I already concluded that I should not
add the images themselves to the database, which makes sense.
I do know I can add images to the resources/drawable folders, but having thousands and thousands of images added here, does not feel as the correct way.
If I want to save paths of the images into the database (which is pre filled), where should I save all the images, so they are accessible with the newly shipped app?
Thank you in advance.

Mysql, sqlite and blob datas, what is the good practice?

Good morning!
I'm currently creating an Android app that have a list of texts and show one randomly. I would like to update the list from a server and I don't know what is the best way to do that.
I plan to use an sqlite database in order to download only the new datas.
Since each text is associated with an image, I consider using Blob in my database, but I don't know if using blob is really a good practce.
Should I store the path to the images instead?
https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems
http://database-management-systems.findthebest.com/compare/30-53/MySQL-vs-SQLite
these two websites can give u a better idea which one to opt. !
Every aspect has been defined in these two sites. Hope i helped u there.
My suggestion:
Making use of JSON support in PostgreSQL is a benefit over other RDBM's
as it's fast.

Android, storing big number of small images linked to database

I have been asked to create a tiny android app.
In everyday work i code for .NET and I have no experience connected with Android, but as it is a really small app I guess it's going to be a good experience rather than something hard.
The core of the app would be a small database (probably XML, unless somebody suggest better solution) that would contain categories, names of the institutions assigned with each category and logo (not very high resolution I guess a single file would be <100kB) of the institution.
The database also would not be very big - I expect not more than 1000 records in total. The DB has to be totally offline and local, it cannot require Internet access when operating.
The model I assume would be to ship new version of the application when the database changes (which is not going to be very frequent).
What is the best way to deal with these requirements?
My first idea was to create an XML file that would contain the records and link to the image. The XML and all the images linked to it would be stored in single file (preferably zip) that would be stored in app resources. This is very good as it is going to be very easy to update the database.
The second idea that somebody suggested me would be to use SQLite and store images in BLOB. In general I have read that it isn't a good idea to store images in database directly, and I am afraid if it's going to be possible to meet all requirements mentioned above.
Mostly I have no idea how to update the database easily and attach it to new version of application.
Any suggestions?
I would be grateful for any response.
I wouldn't go about using XML to save your data and by no means zip anything.
I think your way of thinking is ok, but you're making things really complicated for yourself.
Seeing as you're used to .NET I suppose you're also pretty confident with SQL, so I'd suggest you have a look at how to use the built-in SQLite database in Android.
If you would go the XML route you'd have to serialize and de-serialize the XML file over and over again and then parse the XML. Ok you don't have a lot of data, but searching inside an XML file with at least 1000 nodes would be slow in comparison to the performance of a database.
Also upgrading an existing SQLite database is not that hard - Android has methods for that (onUpgrade coming from the SQLiteOpenHelper).
As to saving images I'm assuming that you won't fetch new pictures from the Internet, so it would be best just to store them in the drawable folder of your app (be mindful of different screensizes) and then reading them into an ImageView when needed. To figure out what image should go for what institution I would store either the image name of each image in the SQLite database or store the resource id for each image in the database - for instance R.drawable.myawesomepictureformyinstitution.
I know my answer is somewhat "superficial", but your question is also somewhat "broad" and hard to answer without me actually writing most of the code, and that's not my intention ;-)
Hope this helps - let me know if anything is unclear.

Ways to save a lot of text and images in Android

Short version at the bottom
I'm working on an android app for a computer game, Heroes Of Newerth. A part of the apps functionality is to list all the heroes in the game. Each hero has:
a short description
a few stats(faction and primary attribute)
an icon
4 spells, which also has:
a short description
a few stats (mana cost, difference in ranks, etc.)
an icon.
There are approximately 110 heroes, which means I have about 500 sets of descriptions and stats.
I made a working version of the app. I downloaded all the images and put them in the drawable folder (note, this was 500 images), and created a Hero Enum which stored name, faction and primary attribute. Obviously, this was a bad idea, as it was horrible looking, and hard to extend to storing the rest of the data.
I have though about using a database, but as I don't have any experience with databases, I'm not really sure as how to do this, especially in Android. I looked it up, and it seems I need to initialize the database on the phone, which means I have to get that data from somewhere - which, again, means I'm back to square one.
I have never worked with this much data in a programming project, and have no idea for how to save it all. As if this is not enough, the game developer, S2 Games, releases new heroes with only weeks in between. As I wouldn't want to update one of my apps every other week, I want the app to be able to update itself with the new data. The best way I see this in my head is you download the app, either with a database of the current heroes, or without any, and the app checks each friday(patches are released on fridays) if the app is up to date. If not, update the database(with text and icons).
Short version
I want to save a few thousand strings, some formated in a special way(unless I can to this afterwards), and about 500 icons. How should I approach this?
Note: I know this was a really bad question, with a horrible structure, but I've been stuck here for weeks, and I couldn't get myself to ask someone, I really need help here!
well it's very recommended that you use sql and databases . you could go to w3schools for the basics .
if you don't want to use DB (or don't have time) , you can store all the data in xml files , and then parse them all . the images should never be part of the DB (or the xml files) , since they cause a bad performance while moving between items.put their names/paths instead .
if the images take a lot of space , consider using google expansion library .

Categories

Resources