Load Images from database [MS SQL Server] - android

I'm working on a project - content listing app.
I would like to know what widget/ component I should use to load images from database and the resources/ references [websites] that I can refer to?
App layout
I wish to have such a layout as shown as above.

It sounds like you want to pull image from a webserver and display then a grid view.
Downloading from the webserver isn't difficult and can be done in a lot of different ways, plus might depend on the rest of your code (But you should make sure to use some type of background threading, to prevent ANR)
Here is a likely better guide on how to setup a grid view.
http://www.mkyong.com/android/android-gridview-example/
as #Anoop Kanyan stated This library looks to be very good for the circle images: https://github.com/hdodenhof/CircleImageView

Related

How to present an Android project when only the layout has to be done

I have to make a new design for an Android App, but I only have to create the visual part (native Android). The app logic would be created by another guy based on what I present to him.
My question is? How would this be managed correctly? Do I have to make the XML's of each layout? How could I show the other person my progress?
What things should I consider when doing this?
Thanks
You need to mock the app first (create a prototype) as suggested by NoChinDeluxe. Then if you guys go ahead and decide to code it, the answer to your problem is separation of responsibilities. As Jeffrey said UI work is not only about layouts, but code as well. What I would suggest is that you and the other guy get together first and define some contracts (interfaces) that will allow you guys to split the work and work in parallel. Therefore, he can create the business logic of the app without worrying about the UI implementation. You, on the other hand, will have to mock that business logic he's implementing at the beginning so it doesn't block your UI work.
you could create layout XML files for all the Activities/screens, using resources (icons, etc as suggested by #NoChinDeluxe). However since you'd want to run the mock app, you might want to also create a "throw-away" Activity that allows you navigate to different screens of the app. Here you can add a number of buttons and when you click on each button, your app shows a specific activity. This way, you will be able to show your colleague all the screens you have created. I hope this helps.
This may not be what you want to hear, but creating Android layouts isn't a design task. They are closely tied to the code, and the design of them is going to depend on how the engineer chooses to implement the app.
Here's an example. You might have a grid with 4 cells. You could use a RelativeLayout, a LinearLayout, or GridLayout, or a GridViewLayout. Which will use choose?
I'd suggest providing your engineer with mockups and graphical assets where required. Let him / her take those and create the layouts. If you want to create layouts as a (visual-only) reference for engineering, great, but it's certainly a non-optimal tool for that task.
Things You will consider when doing visual part:-
You have to work on the resource folder of your application
Layout : All Layout you have to prepare.
Drawable : Images and drawable .xml.
Inside Values folder you will find
dimen.xml : For different devices dimen you can set.
string.xml : You can store string for hint or other purpose.
style.xml : For designing or theme or custom design.
color.xml : Color which are going to used in the application.

Dynamic UI Controls in Android

I am in a situation like i have to generate UI Controls like Button,Switcher,Progress Bar, Label text etc based on my list Items .
I am looking for a way to generate the controls in a View and add Views with generated controls in a Layout .
Can anyone give me a proper way to do that?
Why not to use Fragments?
Google docs about this here
and little tutorial here
You may want to take a look at the Metawidget source code. The Android version of Metawidget makes extensive use of generating Views and Layouts at runtime (e.g. see org.metawidget.android.widget.widgetbuilder.AndroidWidgetBuilder). You may even find Metawidget itself will suit your needs (it's designed to be embedded into projects for use-cases such as this).

Android interface : show form like the grouped listview style?

I'm building an App for Android that already exists for iOS. On iOS, we really like to use the listview grouped style to show details and forms. It is really useful to show details of objects that we don't know how much properties they have before loading it.
I know that Android doesn't have a similar tableview style. And I don't want to use a custom library to recreate it, because I don't want to force an iOS like interface to my Android's users.
But how would you create a consistent Android interface that show similar information? Do you have example for me?
First of all, your instinct to not force iOS style UI onto Android users is correct and I respect you for it.
Android's ListView is roughly the equivalent of iOS's UITableView. There are important differences. For instance, you should never use a ListView inside another scrollable container. If a ListView is in a particular layout, it should (usually) be the only scrollable component. If you want multiple ListViews in a layout, you probably don't want ListViews at all. You should instead use (vertical) LinearLayouts and add the items in order.
Cyril Mottier writes excellent posts on implementing custom behavior for Android's ListView.
If you want to display data in a list then you can use the ListView. Here is a great article about how to use it.

Building an Android button with pictures and text

I am looking to build a button in my Android app which must contain:
A background picture
A picture
Some text
I am coming from iPhone dev and I am a little bit confused by Android development.
While I could addSubView: UIImageView or UILabel to my UIButton, I can't use addView() with a android.widget.Button :(
Does anyone have a solution?
EDIT : Thanks everybody for answers. I forgot to specify I have to do it programmatically, without using XML. I don't know how many element I will display (it depends on RSS).
android:background for background ... remeber that you can build your own 9 patch
android:drawableLeft, android:drawableRight, android:drawableTop, android:drawableBottom to add some picture to the left, right, ... of text
EDIT: i didn't mention ... but i was talking about android.widget.Button
2nd EDIT: after you provide more information i think that all what you need is ListView
check this sample http://esilo.pl/LooserSample.zip (don't take "looser" to yourself, it was sample for another guy)
it showing how to
download a JSON data
store it in db
build ContentProvider for sharing a data
use ContentProvider to take data from db and show it in ListView
dynamic loading images from internet
for simpler sample use your sdk samples like this C:\android\android-sdk-windows\samples\android-8\ApiDemos\src\com\example\android\apis\view\List*.java
if you alrady have code for downloading and storing data from RSS in array extend ArrayAdapter to fit your needs
Most, if not all, of the UI for android is built in the XML. Kind of like the UI builder in Xcode, but not near as advanced. The ADP will let you view the UI you have built in Eclipse, and adjust some basic widget properties.
I believe for what you are trying to do, if I understand right, you need to use an ImageButton widget. This widget allows you to use a complete image as a button. You can also define your own states (button pressed, gain focus, etc) with both the button and image button widgets. You can define a background and add images to both widgets.
More information here

Custom Updatable ListView - Android Development

As a goal for my first Android application to learn the Android SDK, I am trying to create a simple RSS viewer for a specific url. Disregarding the networking side of the goal, I am having trouble with getting a listView to display a custom layout.
What I'd like to do is have each row of a list view show one of two images(read or unread), followed by some text. I'm not really having a problem, it's more that there aren't any examples that I could find (I might be looking in the wrong place) that covered custom layouts depending on conditions in code.
Any help?
Here is a free excerpt from one of my books that discusses the techniques involved. In a nutshell, you will need to extend your Adapter class (e.g., ArrayAdapter, CursorAdapter) and take direct control over the creation of rows, so you can apply your desired business logic.

Categories

Resources