• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Basic layout help needed!

RED_

Well-Known Member
I know this is very basic but i'm having real problems now. I've only just started working on android and cannot get any of the layouts to work for me. So much so that i have changed the design of my app from what i first intended. I'm sure this is all because im a newbie but i still cant get it done. If anything i want to find out what layout is best.

The design will be very similar to the android market with a row of apps for sale at the bottom half of the layout and that slideshow of apps at the top. I can do the slideshow with the gallery class however i cannot find a layout that will let me have an icon on the left hand side while the rest of the row is text. Its exactly the same as the android market when i explain it in the way i have.

Can anyone help? how in the world do you do it if you want a small icon at the start of each row as well as the gallery on the top half of the layout?

Thanks in advance for answers to what is probably a stupid question, but for a newbie like me..
 
Ok its the gallery tutorial thats screwing me now.

Following this one: Gallery | Android Developers

but all im getting is errors can anyone help? I'll get a screenshot up in a sec.

Once i have the gallery bit done for the top of my layout i can work on creating a linear layout for the icons and text i explained in my first post for the second half of the layout.

Code:
[b]Gallery[/b] g = (Gallery) findViewById(R.id.gallery);
	    g.setAdapter(new [b]ImageAdapter[/b](this));

	    g.setOnItemClickListener(new [b]OnItemClickListener[/b]() {
	        public void onItemClick(AdapterView parent, View v, int position, long id) {
	            Toast.makeText(HelloGallery.this, "" + position, Toast.LENGTH_SHORT).show();
	            
	            public class ImageAdapter extends BaseAdapter {
	    	        int mGalleryItemBackground;
	    	        private Context mContext;

Gallery cannot be resolved as a type.
ImageAdaptor cannot be resolved as a type.
OnItemClickListener cannot be resolved as a type.

Very new to this so how can i resolve this issue?

Ok i managed using this tutorial instead, very odd. http://android-er.blogspot.com/2009/08/hellogallery-using-gallery-widget.html

Now i can move on to create a linear layout below with icons and texts just like the market. Think the tutorial you posted mixer should help with that, thanks.
 
Then your problems might be because the tutorials at dev.android do not show that you should import all the types you use. All the imports are shown in the tutorial you link to.
 
I'm just going to throw this out there, but are you trying to make a list with application icons/info about them? Have a linear layout with your galary on the top, then add a list view for the list, check out IconifiedText tutorials, I plan on making on here, but it will not get done tonight
 
Thanks for the tip mate, seems like a very easy way to do it. I have come across a problem however. I'm getting a force close error when running the app in the emulator.

http://img259.imageshack.us/i/forceclose.jpg/

Edit: Made this without using the above tutorials. Only thing now though is too make use of the blank space so text and icon are side by side. Genuinely stumped on that one.

http://img263.imageshack.us/i/sellscreen.jpg/


Nested LinearLayouts with a TextView and ImageView in each one. Done it! Cheers everyone, I bet i'll be back soon as i've got a lot more coding to do!
 
Back
Top Bottom