Best way to learn layouts? - Java for Android App Development

I seem to be really struggling with Android layouts. It's very complicated (compared to iOS) and I just can't figure it out. So, what is the best way to learn layouts? Any help would be greatly appreciated.

sega dude said:
I seem to be really struggling with Android layouts. It's very complicated (compared to iOS) and I just can't figure it out. So, what is the best way to learn layouts? Any help would be greatly appreciated.
Click to expand...
Click to collapse
I assume you've read through the first app's layout training? For sure Android layouts are a bit more complex than the iOS one where you just place an item on the screen at specific pixel coordinates, but it's really not that complcated once you understand the basics. Android has to deal with many different screen sizes, orientations and pixel densities. That is why a simple approach with placing the views at specific pixel positions is not that great (but is still possible - don't use that). Instead, you have to think how is the views position relative to another in a RelativeLayout, or divide your app's UI into rows with LinearLayouts.
Here's an overview about these ViewGroups, but there are many great tutorials for instance here or here on vogella.
If you have a more specific question, just ask here

Related

coding help

i have searched the internet for tutorials or anything that would help and could not find much at all so i figured what better place to ask than here...
i have a little experience in VB and would like to start doing some applications for my PPC. i have done a few small math programs that do simple conversions...as simple as taking input from an input box hitting a button and displaying the output in a label. i would like to learn how to manipulate files, do such things as creating a launcher and doing input functions like the moving of an image like in slide to unlock or scrolling with finger etc. so if anyone could point me in the right direction that would be great whether it be a tutorial or source code or what ever.
thanks in advance and thanks to all the people that provide awesome software and help on this forum...maybe one day i can share something i make
Google is your friend:
http://msdn2.microsoft.com/en-us/library/ms838273.aspx

I Made a Guide to Xperia/WinMo - Comments, Suggestions?

Hi everybody,
I recently completed an extensive guide to the Xperia and Windows Mobile in general. Most of the info might be old news if you're an experienced user, but hopefully there's something in there for everyone. If nothing else, it may be convenient to have all the elemental stuff gathered in one place.
I have tried to compile the best and most common tweaks and customizations, essential software in seven different categories, the many user-interfaces and how to get them, various modifications and some of the highlights from here (XDA Classics), et cetera. I did my best to include as much as possible, and the guide will continue to grow.
Here it is if you want to have a look:
A Guide to Windows Mobile
I put a lot of effort into this and I would really appreciate some feedback, what do you think of it?
I hope you'll find the guide useful.
Thanks --Lars
I am reading it now. You have done an excellent job mate.
This could be the perfect way to beginners to tweak their X1 without doing all the testings we did, with all the hard resets and restore of our backups we did to get all this... If you keep it up to date with all the new software, this could be the ultimate guide to the X1
Great Work!!!
Kudos! Check it out: http://xperiancer.blogspot.com/2009/04/he-made-guide-for-xperiawinmo.html
WoW!
This is a great guide
Keep up the good work
Excellent job - clear and comprehensive.
Comforting to note that I have already come across many of the tips and tweaks, but there are still a few new ones, for which I'm grateful to you.
On the profiles issue, my recommendation would be Phone Weaver - it costs a bit of money, but that is money well spent if you ask me. Highly configurable, very stable, and does the job very nicely thank you very much.
I'm going to have to investigate the JBed font size tweak though - I don't have a "Device Info" folder in the registry so there is no Java Font setting to change.
Thanks great job It will be great to create a wiki ! ;D
I would like to second the well done comments posted here and I have some suggestions. The trend in WM is for big one size fits all interfaces like TF3D and Point UI etc. While such interfaces are nice to look at they dont offer much opporutunity for user customisation, you can change a background and thats bout it.
I am a fan of the Previous system used on the today screen where users select plug-ins and configure them to there own tastes. The two I use most are HomeScreen ++ Floyd theme and TodayGif, all of which had there roots on this site.
How about a list of open source freeware Today Screen Plug-ins that users can customise and change, for users like myself who resent being put in a software straight jacket like TF3D. Other manufacturers like Samsung and Nokia and iphone, are going down the plug-in or widget route, increasing user customisation, while WM seems to be moving in the opposite direction, away from the more flexible, more customisable previous plug-in system.
Thats my 2P, once again good job.
i like the site, very useful!
A big THANK YOU for your work!
I just hoped to find such a great summary of profound knowledge here in the Wiki for the X1.
Once more: Great work! Keep it up!
I’m very glad for all the positive feedback, thank you!
I will make a news box at the top of the page with recent updates and additions, since my ambition is to add all things of interest that I come across to the guide.
msalmank: I appreciate the blog post, cheers
Mr Anderson: I installed the trial version of Phone Weaver, seems like a really good utility for profiles (if not the best of the bunch) - I’ll add it to the guide.
Mark A Cilenti: I intentionally left out the minor Today Plug-ins because I thought they would be of less interest, but I agree: there should be such a section as well.
remixtech: Even though you had a little wink smiley after your wiki suggestion, I took it as a dare and I will make a wiki version of the guide as well that anyone can contribute to (even though chance is no one will write in it)
Thanks again, folks. I'm off to bed
wow this is awesome!
Brilliant! Thank you for your hard work, i've found it very useful.
Altough I am already aware of most of the tips and tweaks listed on your guide I must tell you that it is definitely the best compendium on the X1.
Hats off to you!
Thank you very much for all your hard work.
excellent site.. great work..
I thank deeply from my side.
Definitely comprehensive and sufficient source of almost all needed WM/X1 info!
Any example on your WinMo Xperia Guide about Bottom menu of HelloWorldPanel example
Hi
I tried modifying the HelloWorldPanel example that comes with the SDK.
I still have trouble trying to show the custom bottom menus of the Xperia screen.
Could someone share the code snippets on how to get this to work ?
I like to have 2 menu on the left and on the right, and one menu has items to pick from the list when clicked.
Many thanks!n
Thx.. a very nice site with nice info ^.^
Thanks for all the responses! Great feedback.

need help coding app

Ok so I've never coded in java before its all new to me and i am trying to make an app that would do the same as this (check it out here) old Motorola razr mod, the led's and screens would flash in a pattern when music was played or any vibration into the microphone. I thought this idea could make a cool app for android, so i have begun coding it, and i have pretty much got the interface setup, but when it comes to making the slider i added actually do anything i have no idea and i have no idea how to make buttons actually preform an action, also i have no idea how to go about controlling hardware on the phone like the microphone and various lights to flash. Is there any way anyone can help or give some tips i appreciate any input. Thus far my layout consist of a spinner to chose the different patterns for the lights to flash, then the start button, then a slider to choose how sensitive the microphone is to incoming vibrations. They do nothing yet cause i am not quite sure where to go from here. If you feel you can contribute any knowledge my way i will be grateful, the only coding i have done is minor html stuff although not much different than the xml code involved i have no idea what to do for the java part. Please Help.
Thank you much!
You'll need to use the required APIs detailed here: http://developer.android.com/reference/android/media/AudioRecord.html , I'm not sure you can actually control the sensitivity in Android as I haven't written any apps using the hardware as you want to. And this should help you out with the the backlight: http://developer.android.com/reference/android/os/PowerManager.html
So basically what you would need to do is set up an intent reciever that is listening to the mic, and when theres any input activate the brightness of the display.
For more detailed help I'd have to actually start coding to be of more help. Hope this helps.
Regards,
Akshay

Touch event on masked canvas

I am new to Android app development and have been looking for tutorials on how to use touch events to move around and zoom in and out of a canvas that is seen by way of a mask/viewport. The mask/viewport would, I'm guessing, be the parent layout that has a fixed size and position. The attached .jpg shows a better diagram of what I would like to be able to do. If there are any experts out there itching to create a tutorial, this might be a good one. At least I know I would appreciate it.
cinci-hal said:
I am new to Android app development and have been looking for tutorials on how to use touch events to move around and zoom in and out of a canvas that is seen by way of a mask/viewport. The mask/viewport would, I'm guessing, be the parent layout that has a fixed size and position. The attached .jpg shows a better diagram of what I would like to be able to do. If there are any experts out there itching to create a tutorial, this might be a good one. At least I know I would appreciate it.
Click to expand...
Click to collapse
Well you should read this class on touch events.
From what I understand you want to do, it is something like the Viewer from the Gallery App, so it might be a good idea to take a look at the sources!

[Q] Finding right place to mod an app

I hope this is the right place to post a question about modifying an existing app. In the long run, I want to create a Xposed module to do the modification, but to get started I work with modding the decompiled app. The app in question is de.zeit.diezeit.epaper.android, which is a German newspaper reader app (I am not expecting anyone to know it). What I want to do is to get rid of the scrolling animation when reading an article, because I am using this app on an eInk device (Icarus Illumina).
Now my problem is, I don't find a starting point. I have to say I don't have much (read: almost none) experience with writing Android apps (although I have a lot of programming experience otherwise). Thus I have no idea how such an animation would be implemented. I searched for references to the Scroller class and replaced the duration argument of the startScrolling method by 5ms, but this didn't change anything.
Is there any way to run the app in some kind of debug mode to see which methods are called at which time? Another idea how to find the right spot might be the trigger of the scroll: I am using the hardware page turn buttons of the device to scroll down exactly one page. How would this be implemented, what should I search for to find the code that reacts on these buttons? (Also: how can I press these buttons in the emulator?)
I am sorry if I am asking too many noob questions. If there is relevant documentation I have obviously missed, please point me to it. Thank you very much for any help!
Try looking under res/anim*
mhier said:
I hope this is the right place to post a question about modifying an existing app. In the long run, I want to create a Xposed module to do the modification, but to get started I work with modding the decompiled app. The app in question is de.zeit.diezeit.epaper.android, which is a German newspaper reader app (I am not expecting anyone to know it). What I want to do is to get rid of the scrolling animation when reading an article, because I am using this app on an eInk device (Icarus Illumina).
Now my problem is, I don't find a starting point. I have to say I don't have much (read: almost none) experience with writing Android apps (although I have a lot of programming experience otherwise). Thus I have no idea how such an animation would be implemented. I searched for references to the Scroller class and replaced the duration argument of the startScrolling method by 5ms, but this didn't change anything.
Is there any way to run the app in some kind of debug mode to see which methods are called at which time? Another idea how to find the right spot might be the trigger of the scroll: I am using the hardware page turn buttons of the device to scroll down exactly one page. How would this be implemented, what should I search for to find the code that reacts on these buttons? (Also: how can I press these buttons in the emulator?)
I am sorry if I am asking too many noob questions. If there is relevant documentation I have obviously missed, please point me to it. Thank you very much for any help!
Click to expand...
Click to collapse
Hi, very late after the question, but I am considering buying an Illumina XL HD e-reader in order to have e-ink to read newspapers. What has been your experience with your device (which model in particular is it?)? Also, I would like to root it. Do you know if that is possible? Finally, did you manage to modify the app? If so, was it difficult?
Hi, hope you found the solution

Categories

Resources