[Q] Confused with coding for layout. - Android Software Development

Hi there, long time lurker first time poster here!
Slowly getting into android but i really cant get my head around the layouts. I would love to be able to use the AbsoluteLayouts but that isn't a good idea anymore.
Basically after some work i have managed to get a gallery working at the top of the screen. I want my app to look like this in essence: Ok can't post outside links at the moment, fair enough. Think of the android market. Icons to the left and a bit of information for each app next to it and a buy button on the right.
However i have no idea where to start off. Since i have the gallery already i have no idea how i can add things underneath it without screwing anything up.
Can anyone help? Thanks in advance!

Sorry to bump but the issue has changed, I have built an app but would like like the text to be besides the icon. Any chance someone can help? Using a linear layout.
http://img263.imageshack.us/i/sellscreen.jpg/

RED_ said:
Sorry to bump but the issue has changed, I have built an app but would like like the text to be besides the icon. Any chance someone can help? Using a linear layout.
http://img263.imageshack.us/i/sellscreen.jpg/
Click to expand...
Click to collapse
Are you using a List View? Looks like one.
How do you build up your content for the list?
In my view the best solution for your problem would be:
- Use a ListView
- Build your own ListAdapter (drived from BaseAdapter for example)
The Adapter builds the view for each item (or recycles an already built up view, the ListView handles that).
The view for each item would be a horizontal oriented LinearLayout with two items (the image and the text) and the adapter fills the layout with the information of the current item.
For better layout handling I would define the layout for the items in an extra xml file and use the LayoutInflater-Service inside the Adapter (if a view has to be built).
Hope this helps and points into a helpful direction
Devmil

Thanks for replying, managed to find a solution in the end without using ListView. Thought about moving to a RelativeLayout as its more effcient but as my app is very small anyway in the end i've just gone and used nested LinearLayouts with a textview and imageview in each one.
Ridiculously simple when you look back on it.
I was actually going to use this tutorial which does what you explained i think: http://www.anddev.org/iconified_textlist_-_the_making_of-t97.html but it left me with a force close error so that went out the window.

Related

converter program (finger friendly) need suggestions

Hi wanted to create my first program..
right now Im trying to make a unit converter that is finger friendly..
so far I've tested it and here is what I have so far..
any suggestions? regarding the buttons positions, the interface, etc?
thanks
Hi Providense,
Looks good so far.
Do you have a development schedule as to what it will convert?
Keep it up.
John
Provedence,
It seems that some people like to have a configuration facility.
So perhaps some suggestions:-
Favorites so that the list can be tailored to favorites for that person to save a more compact list of 'things to convert'
I would be happy to have any theme for now but cooks may prefer to add there own theme.
I have used this type of function with calculator type programs but they can become unweildy so one that is specific would be usefull.
Thanks
John
thanks Johny1fin
as of now these are the things i've done
Temperature:
degree Celsius
degree Fahreheit
degree Rankine
degree Reaumur
kelvin
Acceleration: (still doing it right now)
centigal
centimeter/square second
decigal
decimeter/square second
dekameter/square second
foot/square second
g-unit(G)
gal
galileo
gn
grav
hectometer/square second
inch/square second
kilometer/hour second
kilomter/square second
meter/square second
mile/hour minute
mile/hour second
mile/square second
milligal
millimeter/square second
still a long way to go. But the Acceleration should be done by today.
Then I'll add Area, Date/Time and etc
I like the idea of favorites. I'll see if i can implement that. Im still a beginner at programming. Using VB.net 2003 right now
oh by the way. Here's the main menu, where I will put all the buttons
providence said:
Hi wanted to create my first program..
right now Im trying to make a unit converter that is finger friendly..
so far I've tested it and here is what I have so far..
any suggestions? regarding the buttons positions, the interface, etc?
thanks
Click to expand...
Click to collapse
Providence,
It may be a limitation of the APIs but could the vertical scroll buttons be next to each other horizontally rather than vertically as this may produce larger buttons?
John
Look nice.. however, on the finger friendly issue, you may want to avoid the scroll list (on your first screenshot) and have another screen for the choice of (say) different temperature units. Something like, making a screen (of your second shot) for temperature units. If you get what i'm trying to say
thanks for the feedbacks i've changed how the scrolling works. Now im using a custom button for that.
Looking good providence
I am not sure if you like this idea, but I think it will be more useful if you can add:
- Currency converter
- Currency quick view (to view several currencies at once)
There is an example of a very nice and complete project with source code here:
http://www.codeproject.com/netcf/PocketCurrency.asp
Add option to have automatic currency update as well
[ x ] Update when connected to ActiveSync
[ x ] Automatic update every X hours
hi, well the main idea was to create a finger based Unit conversion program. To add Currency Converter would be a challenge for myself.
Since first of all, Currency changes daily, so there must be a way to update it. Secondly, im still learning how to program by self teaching myself on my free time.
By the way, Here's the latest screenshot of the program.
I fixed the buttons so its easier to use.
unfortunately, this will only work on PDAphones and not on smartphones. Since you'll need to use the touch screen as input method.
Here is an idea, as mentioned by one of the post above, instead of stacking your scroll button up and down, it may save you that more space if you were to stack them left and right.
From what it seems, the < and > , are buttons, which you use it to 'affect' your lists. If you were to (example) sandwish your list in between these two buttons, you would save like another 2 button height. Example.
Currently, you have the layout
Code:
. item1 <
. item2
. item3 >
. item4
if you can just do this (which is possible in VC, not sure about VB), instead
Code:
< .item1 >
.item2
So, instead of 4 item height, you are now only left with 2 items height.
ahh i see..
I tried doing it
< item 1 >
item 2
but i find it harder to navigate, since when you go back you have to drag your finger across the other side of the screen. And while doing that, you are blocking the item list with your finger.
I dont need to save space, i think i got everything in there..
by the way, here's the test i took
then again, if i put them on the sides, it makes easier for those who are left handed as well
The spaces you save, may able you to bloat up the keypad below.. from what it seems, now they are on the 'flat' side of it.
If you think the "left-list-right" is not very finger friendly, you can try the "list-left-right"? That is
.item1 < >
.item2
Hi thanks for the suggestions..
right now here is what i have, and will probably be the final change in the button positioning..
i got big fingers and I can use them without stylus.
Should have a pre-alpha version ready soon. As of now I've done temperatures and acceleration.
Will add more soon

[REQ] Help to create text and walk app

I am looking for some help from the many people on here more talented than me, I have very basic programing skills but am hoping to learn more though this process.
The plan : Create an app for winmo that can do similar to this http://www.theregister.co.uk/2009/05/14/email_n_walk/ ideally for texting as well as email.
My ideas so far (very early stages):
1. Use the generic windows messaging screen and replace the white standard background with a transparent one, probably with shaded area for tx to make it readable, and call the camera app behind it.
2. Use the tf3d messaging screen and use something like MunBackground all tabs to again run the camera view instead of a static picture.
In an ideal world I would only like to use one of these methods meaning that text/email could be written with or without the camera app running.
I would appriciate any input and help with this, I am well aware this will be made more difficult with my lack of experience, but am hopful that the wealth of knowlege here can help.
Im sorry, i cant offer my help, but you have my support; this would be great, especially for wvga devices.
If I understanded, you want transparent screen to send messages?
I'd be willing to donate some money toward anyone who could create such an application.
I'm sure came across this before as an idea if i'm reading it correct, the problem being that when we walk we don't hold the phone up infront so we'd be viewing the floor infront of our feet
One way would be to take a picture every x ms and draw it and additional items like rectangles and text in the paint method of a panel control.
P.S.: How would it look like in manila? Remember this fake/bug live camera image in home screen?
bug description
stylez said:
I'm sure came across this before as an idea if i'm reading it correct, the problem being that when we walk we don't hold the phone up infront so we'd be viewing the floor infront of our feet
Click to expand...
Click to collapse
Possibly not completely upright, but maybe 45 deg, and would still stop you tripping over stuff!!
heliosdev said:
One way would be to take a picture every x ms and draw it and additional items like rectangles and text in the paint method of a panel control.
P.S.: How would it look like in manila? Remember this fake/bug live camera image in home screen?
bug description
Click to expand...
Click to collapse
In my head, it would ideally be a seperate way of opening/writing text/email to save battery life when not needed, and would probably be a video/camera image behind, with a semi transparent overlay/greyed out area where message text was typed to enable the text to be readable.
Will try out that diamond bug/fake

[Q] ListView without scrolling

Is it possible to create a ListView that only displays all of it's content and does not try to be scrollable ?
I need ListViews, because it's the most convenient solution for my app. I have 3 types of content and each has it's own layout style, own context menus and some of them have on click listeners in one case and context menus in other cases. I have a pretty elegant and sexy solution for this, but it only works with ListViews.
The problem is that I want to have all 3 types of content on one screen that will scroll as ONE, but with multiple list views it scrolls as a whole and all lists scroll independently, which makes my app an unusable piece of ****e.
Please only suggest solutions that use list views.
One that I could think of is to create 3 different screens with flip view or maybe some kind of tab view. Or maybe both and let the user choose. What do you think ?
2 things (as I know you're a good programmer, but still kind of "new") LOL
1. Maybe you can @Override the onTouch methods and disable the scroll
2. Don't EVER get so stuck on an interface (or a method, or a piece of code) that you get into a mindset of "It HAS to be this way". Many hours/days I have wasted with this kind of thinking and sometimes, you just have to give-up and start over.
I know you're in a time constraint, but I also find if I leave a problem for a day or two and come back to it, a solution presents itself.
I already put it aside a few days ago, but I'll have to deal with it soon. Actually I just came up with the tab view idea while writing this post and it seems like a good solution (even better than the original with all 3 lists on one screen).
SOLVED
I implemented a tab layout. Like a BAWSSS.

[Q] ActionBarSherlock - Tabbed navigation AND integrated spinner possible?

Hi all,
Title really says it all. I have a tabs set up at the moment but I want to add a spinner to the action bar as well. To use as sort of a category tool. So a user can go through the tabs but also simply what they are seeing by selecting something from the dropdown spinner.
I've seen tutorials for a spinner in the actionbar and they require the navigation to be changed to list
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
Mine at the moment is of course
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Is it possible to have both? I have a title and tabs underneath to the title action bar is empty at the moment, a perfect place for a spinner. This is what I have right now: http://i1.ytimg.com/vi/ppuv-FP6c4w/maxresdefault.jpg I'd like to be able to add a spinner that is always showing where it says 'ABS ViewPager Tabs'
Any help would be appreciated. Haven't found a tutorial that integrates both yet.
RED_ said:
Hi all,
Title really says it all. I have a tabs set up at the moment but I want to add a spinner to the action bar as well. To use as sort of a category tool. So a user can go through the tabs but also simply what they are seeing by selecting something from the dropdown spinner.
I've seen tutorials for a spinner in the actionbar and they require the navigation to be changed to list
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
Mine at the moment is of course
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Is it possible to have both? I have a title and tabs underneath to the title action bar is empty at the moment, a perfect place for a spinner. This is what I have right now: http://i1.ytimg.com/vi/ppuv-FP6c4w/maxresdefault.jpg I'd like to be able to add a spinner that is always showing where it says 'ABS ViewPager Tabs'
Any help would be appreciated. Haven't found a tutorial that integrates both yet.
Click to expand...
Click to collapse
Since the ActionBarSherlock library is closesly related to the native action bar, I googled and found this similar question. It seems that, using these libraries it is not possible, however there are several methods to use instead (but those aren't so nice).
Bugger. Guess I could try doing it with a custom view and work from there like shown in that link. Hmmm, might have to rethink how my app lets users navigate.
That stuff that I plan to put in the spinner has to be somewhere so I guess I should look to creating this custom actionbar thingy. Hopefully the output is smooth. Already using a ViewPager that the guy who answered mentioned so this may not be too hard.
RED_ said:
Bugger. Guess I could try doing it with a custom view and work from there like shown in that link. Hmmm, might have to rethink how my app lets users navigate.
That stuff that I plan to put in the spinner has to be somewhere so I guess I should look to creating this custom actionbar thingy. Hopefully the output is smooth. Already using a ViewPager that the guy who answered mentioned so this may not be too hard.
Click to expand...
Click to collapse
This video from Google I/O 2013 helped me very much with my app navigation design: http://www.youtube.com/watch?v=XpqyiBR0lJ4&list=PLOU2XLYxmsIJOOTFfYzhR2d-rcSbBbEE_
nikwen said:
This video from Google I/O 2013 helped me very much with my app navigation design: http://www.youtube.com/watch?v=XpqyiBR0lJ4&list=PLOU2XLYxmsIJOOTFfYzhR2d-rcSbBbEE_
Click to expand...
Click to collapse
Thanks, I'll give that watch.
I'm currently using GridViews with custom adapters to show my content under each tab so if I could have an onClick change what the getView() method of the adapter shows to a user I could just keep it really simple and have simple buttons instead of a spinner.
That seems like a good option at the moment.

[Q] How to display data in table!?

Hello Guys, I'm a newbie in app development so help me with this (simple) query.
I have an activity with 4 text box asking for user input (name, place, date, time) . Now how to combine these data into a table in another activity.
PS: I have included exit button in main activity. Is it ok or should I include exit option in action bar menu only? Also what is the java function to exit the app?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Hello Guys, I'm a newbie in app development so help me with this (simple) query.
I have an activity with 4 text box asking for user input (name, place, date, time) . Now how to combine these data into a table in another activity.
PS: I have included exit button in main activity. Is it ok or should I include exit option in action bar menu only? Also what is the java function to exit the app?
Click to expand...
Click to collapse
Hi,
You can easily get a Table with the TableLayout, where in each TableRow you would put two EditTexts. In Android you usually don't need to put an edit button in the layout unless you have a service running or so since there is the back button to easily exit. The Java code to exit would be calling this.finish() from the activity.
SimplicityApks said:
Hi,
You can easily get a Table with the TableLayout, where in each TableRow you would put two EditTexts. In Android you usually don't need to put an edit button in the layout unless you have a service running or so since there is the back button to easily exit. The Java code to exit would be calling this.finish() from the activity.
Click to expand...
Click to collapse
Thanks for your suggestion, but I want all the four editText in a single row. How to do it,? Or is there any detailed tutorial?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Thanks for your suggestion, but I want all the four editText in a single row. How to do it,? Or is there any detailed tutorial?
Click to expand...
Click to collapse
You can find a tutorial on the TableLayout here. But if you just want one row, it's easier to just use a LinearLayout with equal weights for each View. If you want to reuse this layout for another activity, put it in a Fragment!
SimplicityApks said:
You can find a tutorial on the TableLayout here. But if you just want one row, it's easier to just use a LinearLayout with equal weights for each View. If you want to reuse this layout for another activity, put it in a Fragment!
Click to expand...
Click to collapse
Thanks but Actually I'm building an app to keep track all the user's debt. So I want to display the debts in a tabular view. It can be single or multiple varying with every user. So what should I use here?
Also how to place the data got from 4 different edittext as single object into another activity?
Sent from my Xperia Mini using Tapatalk 2
ariftwister said:
Thanks but actually I'm building an app to keep track all the user's debt. So I want to display the debts in a tabular view. It can be single or multiple varying with every user. So what should I use here?
Also how to place the data got from 4 different edittext as single object into another activity?
Click to expand...
Click to collapse
You may want to have a look at the samples of the TableFixHeaders library here to do your Layout. Remember putting it in a separate Fragment in case you want to reuse in another activity.
For data passing you need to put it as extra into the Intent you're starting the second activity with. The data structure you use depends on what you want to do. I recommend dropping everything into a new Bundle and pass that on, that way you can also save/restore when rotating. But if you have only the same data like 4 Strings or 4 doubles you could also directly put it as an array extra with intent.putDoubleArrayExtra or putStringArrayExtra

Categories

Resources