Screen size help - Android Software Development

I am attempting to create a layout with two objects of different sizes, one of which will be bigger than the other, about 80% of the screen. The other object will be the remaining 20%. Obviously you cant use percentages in the XML layout to make these objects the right size. Is there a better way to create these objects(they will be some type of view with a background that is a shape drawable) so that i wont have to get the screen resolution from java and do the math in there?
Thanks for the help.. if i get any this time..

Come on some one has to know.. this issue is holding my development up, i cant really go any further until i got this figured out.

I think dips (density independent pixels) are what you want to use. The android dev guide covers them. I can't post a direct link yet because I'm waiting for my account to be verified but a google search for "android dip unit" should get you to the relevant documentation.

Let's say you are using a vertical linear layout. Get screen size, sets smaller objects height to .2* screen height and the others height to fill parent.
Sent from my Nexus One using XDA App

Thanks for the replies. I will retry dips, they didnt seem to come out the same on my G1 as the did on the Evo. But maybe i failed somewhere. If it comes down to it I will just have to use java to resize the screen.

Related

Text size and temporary vision impairment

I have been going through phases of intense tiredness which after loads of tests at hospital and my doc, they have said it chronic fatigue syndrome.
I can get so physically tired I cannot keep my balance when walking or focus my eyes, however am still awake enough to use the phone although I slur.
The problem is my eyes are OK, but I get so tired I cannot see to read the letters on the screen and I cannot hold the device far enough away to get things in focus even at the largest text.
My doc says there is little point in seeing an optician as when I get more awake again I can see things fine, and the intensity of the problem will vary with how tired I am - so the only way I can see to address this is to have text larger than the current largest.
Is there any way of doing this. or getting the wizard to read me the text?
Or alternately any other suggestions?
A neighbor of mine was diagnosed with something similar, he's in his 40's. He has sleep apnea (sp?) and wears a mask to create pressure and give slight amounts of oxygen. He also had a sleep test done, and found out he has 900 leg twitches at night (I thought restless leg syndrome was BS at first). The leg twitches don't let him go into REM deep sleep so he's ALWAYS tired. Even to the point of being pulled over for "acting drunk" (I've never seen him even have a beer, ever).
He's improved now with some RLS medication and the mask, much more energetic. He's a carpenter, so quite active during the day, and looks pretty fit. Anyway, I'm not a doctor, but just odd that you mentioned your issues, and it sounded like his, because he cannot read his smartphone later in the day.
The MDA seems to have a tiny screen compared to some of the older PDA's. I really wish all PDA's had 640x480 screens instead of 320x240, it would make it so much more readable.
To change the system font size
1) On the Home screen, click Start > Settings System Tab > Screen.
3) Enable Cleartype using tab at the bottom (optional, might help)
2) Select Text Size tab, slide slider to larger or largest to set the size of the font that is displayed on the screen. It doesn't do it for EVERYTHING, but it might help with tasks, emails and calender
Click OK along the top right.
There are some registry tweakers out there that claim to be able to change the font size, or even the font itself to another font. Or you can research how to change registry settings yourself. Good luck!

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] Live Wallpaper Falling Images and Sizes

I am wondering how to take a bitmap image and have it drop vertically from the top of the screen to the bottom and then wrap and do it again. I can only find how to rotate it around a certain access in the help portions. I'm assuming we can use different speeds as well to do the dropping. Also, what sizes need to be set in the hdpi and so forth? It seems that 920x740 is way to big of a picture for that folder and would be a memory hog.
I've not done any wallpapers apps, but typically, to do what you intend, you'd create a thread (class derived from java.lang.Runnable) with a simple loop and a wait timer (call Thread.sleep(). As the loop iterates, send a message to a class derived from android.os.Handler. In the handler, update your coordinates and refresh your view with view.invalidate().
What has it drop? I'm curious how you have your program realize it needs to drop down and then wrap around. All I understand is how to make it rotate around a set axis point.
bearcatext said:
What has it drop? I'm curious how you have your program realize it needs to drop down and then wrap around. All I understand is how to make it rotate around a set axis point.
Click to expand...
Click to collapse
You're thinking at too high level. There is no built in api for falling objects or animating bitmaps, you need to do it yourself.
The way I do it on my doom live wallpaper is to create a java object for each character or projectile I want to draw. The object contains variables for current x and y coordinates on screen and a method to update the position for a new frame.
That makes sense, that is what I was thinking on my drive home today that maybe all it was is setting the x or y coordinates and subtracting or adding depending on how you want it to look. Thanks for the response though I think this is the second time you've helped me out so I appreciate it.

Need Some help with layout in calculator app

i have attached a picture here
1.) how do i set the buttons so that they look uniform throughout different devices (screen size , tablets etc) right now they look different on the emulator and on a device
2.)i also need some help in implementing some code like when i press Shift Button and then press a button it will alternate between functions of that button .. please guide me on how to implement this ?
also is there an easier way to implement a custom grid of buttons rather than using relative layout for all buttons i have looked into gridview but do not know how to customize it ?
please help .. thanks
Make linearlayouts for every row with height wrap and width match. Now for every child button of that linear layout set width as match parent and height wrap_content.and also add another line in all the buttons android:layout_weight="1"
There can be another approach as well. You can use table layout which is easy. You can find guides on Google for it
Sent from my XT1033 using XDA Premium 4 mobile app
arpitkh96 said:
Make linearlayouts for every row with height wrap and width match. Now for every child button of that linear layout set width as match parent and height wrap_content.and also add another line in all the buttons android:layout_weight="1"
There can be another approach as well. You can use table layout which is easy. You can find guides on Google for it
Click to expand...
Click to collapse
Agreed, use a TableLayout (containing multiple TableRows. I suggest reading this doc about creating a table.
umartariq94 said:
1.) how do i set the buttons so that they look uniform throughout different devices (screen size , tablets etc) right now they look different on the emulator and on a device
2.)i also need some help in implementing some code like when i press Shift Button and then press a button it will alternate between functions of that button .. please guide me on how to implement this ?
also is there an easier way to implement a custom grid of buttons rather than using relative layout for all buttons i have looked into gridview but do not know how to customize it ?
Click to expand...
Click to collapse
A totally different option to consider here would be using a KeyboardView instead! That way you won't have to deal with all the buttons (and I think the shift function might be easier as well). As it happens, I wrote a guide on how to implement such a custom keyboard a while ago . You just have to make the KeyboardView a little larger and delete the part where the back key hides it. Be warned though, this class is highly undocumented and it's not guarenteed everything is working the way it should.
Thanks for the replies !

Categories

Resources