Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: Binder News on May 15, 2011, 01:54:16 am

Title: Programming for Android
Post by: Binder News on May 15, 2011, 01:54:16 am
I'm starting this just for general discussion of programming for Android in Java. Discuss away.
Title: Re: Programming for Android
Post by: ZippyDee on May 15, 2011, 02:00:10 am
The SDK is very well done, but the fragments/activities/surfaces/views confuse me a bit.
Title: Re: Programming for Android
Post by: Binder News on May 15, 2011, 02:17:02 am
What exactly do you want to know?
Title: Re: Programming for Android
Post by: ZippyDee on May 15, 2011, 02:19:46 am
Well, I guess the issue really comes with when each one is used...I don't fully understand all the functionality of the SDK yet, so I'm still learning about what situations are ideal to really look at using things such as either threads or timers for updating views, and even then whether I should update a regular view or a SurfaceView with callback or all those things. It's really just situational questions about what's the best way to do things...
Title: Re: Programming for Android
Post by: Binder News on May 15, 2011, 02:35:32 am
Well, SurfaceViews are used for graphics rendering. My suggestion is to have an entirely separate thread entirely for the purpose of calling
Code: [Select]
c = surface.lockCanvas();
//draw on Canvas c
surface.unlockAndPost(c);

Regular views are used more for input events an such. For example, I have a regular view that I have extended and turned into a Joystick class. I have that separated from the SurfaceView that I use for rendering.
Title: Re: Programming for Android
Post by: Snake X on May 22, 2011, 03:10:46 pm
hmm speaking of java and android are you able to program and compile java into java bytecode and run it on android? I have tried to google this and never found the solution.. I would like it if I could do programming on say.. a motorola xoom.
Title: Re: Programming for Android
Post by: ZippyDee on May 22, 2011, 03:25:38 pm
As far as I know there isn't a way to write actual apps on the android itself...