Hi everyone, I'm trying to draw a graph on XY coordinate, but as you all know, the origin in computer graphic is at the top left corner, and the y-axis is pointing down for +ve.
I managed to translate the origin to center of the screen using canvas.translate. But I would like to make the y-axis orientation is up for +ve as normal cartesian system. Anybody know how to turn the y-axis upside down in Android?
Thanks
I've done my share of math (algebra, trig and Calculus 1,2,3) but it was years ago. I don't recall what "+ve" is but if you are wanting to move the origin to the center of the screen I would think that you would set this once:
Y_ORIGIN=SCREEN_HEIGHT/2
Then whenever you needed to translate a Y Coordinate you would use:
ACTUAL_Y=Y_ORIGIN - OUR_Y
I don't know the Android code for determining the screen height.
Sorry, if this isn't what you are asking for.
Thanks for the reply man. Anyway, I juz figured out how to do that, juz by playing with some scale and translate function with canvas in Java.
Related
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
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
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.
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.
Hi everybody. I searched google but could not find something enough siple for me. Could you
please help me.
The case is this: There is a ball on scene and a kick button also there is a gui object
which is for determining the ball direction.
There is 120 level on gui object. The level is changing by time but I want it to be fast,
because user should not catch it easly. Cany we change the levels according to milisecond
for example per 2 milisecond 1 level.
After this, how can get the value of guı object's value when I press the kick button and
give it to ball as a direction. Thanks a lot for your helps.
By the way, I am using javascript.