Difference between revisions of "Hello World for Android"

From JPCT
Jump to: navigation, search

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 861

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 862

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 587

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 587

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/diff/DairikiDiff.php on line 608

Deprecated: assert(): Calling assert() with a string argument is deprecated in /usr/home/ws10522/public_html/wiki/includes/di
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
This code should help to get you started. It displays a simple, lit cube that you can rotate by using the touch screen. It includes basic pause/resume handling.
 
This code should help to get you started. It displays a simple, lit cube that you can rotate by using the touch screen. It includes basic pause/resume handling.
 
I'll post the complete source code and comment on some important parts later on the page.
 
I'll post the complete source code and comment on some important parts later on the page.
 +
 +
Please note that this example is meant to be really basic. Usually, you don't want to have all these fields in your Activity but in some other class of yours instead. For this example, i tried to keep things really really simple, which is why everything in part of the Activity. Don't take this as an example of great design.
 +
 +
Also keep in mind that this code has been written to be executed on an old Android 1.5 "powered" device. On a current device, some tweaks might not be needed anymore. I'll comment on that in more detail in the source code comment part of this page.
  
 
====The source cde====
 
====The source cde====
Line 307: Line 311:
 
This is the basic touch event handling. There are two things to note here:  
 
This is the basic touch event handling. There are two things to note here: