<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mgBlog &#187; Android</title>
	<atom:link href="http://mgsimon.de/tag/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://mgsimon.de</link>
	<description>Esc(ape), einfach ein anderes Blog über technische Spielerei ...</description>
	<lastBuildDate>Sun, 18 Dec 2011 08:52:23 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Android und JSON, JSONViewer ein Beispiel</title>
		<link>http://mgsimon.de/2011/11/10/android-und-json-jsonviewer-ein-beispiel/</link>
		<comments>http://mgsimon.de/2011/11/10/android-und-json-jsonviewer-ein-beispiel/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:47:31 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mobil]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=3129</guid>
		<description><![CDATA[JSON wegen der Einfach- und Kompaktheit ideal f&#252;r die mobile Kommunikation, enth&#228;lt das SDK von Android einige Klassen der Referenzimplementierung. Ein kleines Beispiel kurz notiert &#8230; Kofiguration Im Manifest f&#252;r Android wird die Berechtigung f&#252;r den Zugriff auf das weltweite Netz (Zeile 7) konfiguriert. 1 2 3 4 5 6 7 8 9 10 11 [...]]]></description>
			<content:encoded><![CDATA[<p>JSON wegen der Einfach- und Kompaktheit ideal f&#252;r die mobile Kommunikation, enth&#228;lt das SDK von Android einige Klassen der Referenzimplementierung.<br />
<div id="attachment_3370" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/10/AndroidJSONViewer.png" alt="Android :: JSONViewer" title="Android :: JSONViewer" width="442" height="265" class="size-full wp-image-3370 stamp" /><p class="wp-caption-text">Android :: JSONViewer</p></div>Ein kleines Beispiel kurz notiert &#8230;</p>
<p><span id="more-3129"></span><div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter Mac OS X 10.6.8 mit der Java Version 1.6.0_26, Eclipse EE 3.7.1 Indigo und ADT (Android Development Tools) Plugin f&#252;r Eclipse durchgef&#252;hrt. Siehe auch <a href="http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/">Hello World Android unter Linux</a> …</div></p>
<p><strong>Kofiguration</strong></p>
<p>Im Manifest f&#252;r Android wird die Berechtigung f&#252;r den Zugriff auf das weltweite Netz (Zeile 7) konfiguriert.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifest</span> <span style="color: #000066;">xmlns:android</span>=<span style="color: #ff0000;">&quot;http://schemas.android.com/apk/res/android&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">package</span>=<span style="color: #ff0000;">&quot;de.mgsimon.android.jsonviewer&quot;</span> <span style="color: #000066;">android:versionCode</span>=<span style="color: #ff0000;">&quot;1&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">android:versionName</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-sdk</span> <span style="color: #000066;">android:minSdkVersion</span>=<span style="color: #ff0000;">&quot;8&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.INTERNET&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">android:icon</span>=<span style="color: #ff0000;">&quot;@drawable/icon&quot;</span> <span style="color: #000066;">android:label</span>=<span style="color: #ff0000;">&quot;@string/app_name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;.JSONViewerActivity&quot;</span> <span style="color: #000066;">android:label</span>=<span style="color: #ff0000;">&quot;@string/app_name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.intent.action.MAIN&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.intent.category.LAUNCHER&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/activity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><em>JSONViewer/AndroidManifest.xml</em></p>
<p><strong>Layout</strong></p>
<p>Das Layout enth&#228;lt ein Eingabefeld (EditText) f&#252;r die URL, ein Button (ImageButton) zum abrufen der URL und ein mehrzeiliges Textfeld (TextView) zum anzeigen.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;RelativeLayout</span> <span style="color: #000066;">xmlns:android</span>=<span style="color: #ff0000;">&quot;http://schemas.android.com/apk/res/android&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span> <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;LinearLayout</span> <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/linearLayoutUrl&quot;</span> <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;match_parent&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EditText</span> <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/editTextURL&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000066;">android:singleLine</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;0dp&quot;</span> <span style="color: #000066;">android:layout_weight</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;requestFocus<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/requestFocus<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EditText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ImageButton</span> <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/imageButtonLoad&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000066;">android:src</span>=<span style="color: #ff0000;">&quot;@android:drawable/ic_media_play&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;0dp&quot;</span> <span style="color: #000066;">android:layout_weight</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/ImageButton<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/LinearLayout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ScrollView</span> <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span> <span style="color: #000066;">android:layout_below</span>=<span style="color: #ff0000;">&quot;@+id/linearLayoutUrl&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">android:layout_margin</span>=<span style="color: #ff0000;">&quot;5dip&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TextView</span> <span style="color: #000066;">android:id</span>=<span style="color: #ff0000;">&quot;@+id/textViewContent&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:layout_width</span>=<span style="color: #ff0000;">&quot;fill_parent&quot;</span> <span style="color: #000066;">android:layout_height</span>=<span style="color: #ff0000;">&quot;wrap_content&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">android:textAppearance</span>=<span style="color: #ff0000;">&quot;?android:attr/textAppearanceMedium&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ScrollView<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/RelativeLayout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><em>JSONViewer/res/layout/main.xml</em></p>
<p><strong>Activity</strong></p>
<p>Die Aktivit&#228;t JSONViewerActivity erweitert Activity (Zeile 26) und initialisiert notwendige Komponenten in der &#252;berschriebene Methode onCreate (Zeile 37). Referenzen zu Elementen des UI werden &#252;ber findViewById (Zeile 41,43 und 44) gesetzt und dem ImageButton (Zeile 45) wird die aufzurufende Methode f&#252;r das Event onClick (Zeile 48) &#252;berschrieben.</p>
<p>Die Methode onClick &#8211; aufgerufen durch Klick auf dem Button &#8211; startet mit &#252;bergebener URL (Zeile 50) einen Thread (Zeile 51). Die Klasse UrlLoadTask zeigt vor (Zeile 63) dem Thread einen Status an und aktualisiert die Aktivit&#228;t nach (Zeile 94) dem Thread. </p>
<p>Die Daten werden unabh&#228;ngig des Threads f&#252;r die Benutzeroberfl&#228;che in der Methode doInBackground (Zeile 69) verarbeitet.  </p>
<div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Application not responding (ANR) Meldungen werden nach etwa drei Sekunden geworfen, wenn die Benutzeroberfl&#228;che blockiert wird. Alle langl&#228;ufigen und unbekannten Laufzeiten nebenl&#228;ufig ausf&#252;hren, dann klappt es auch ohne ANR.</div>
<p>Im Hintergrund herunterladen (Zeile 71-73), JSONObject erzeugen (Zeile 74) und die TextView aktualisieren (Zeile 97).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.mgsimon.android.jsonviewer</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URI</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URISyntaxException</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.HttpResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.ParseException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.ClientProtocolException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.HttpClient</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.methods.HttpGet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.impl.client.DefaultHttpClient</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.util.EntityUtils</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.json.JSONException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.json.JSONObject</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.ProgressDialog</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.AsyncTask</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.EditText</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ImageButton</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> JSONViewerActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">private</span> EditText mEditTextUrl<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> ImageButton mImageButtonLoad<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> TextView mTextViewContent<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> URI mUri<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">private</span> ProgressDialog mProgressDialog<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span>
  @Override
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    mEditTextUrl <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EditText<span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">editTextURL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    mEditTextUrl.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://mgsimon.appspot.com/aboutmyrequest&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    mTextViewContent <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">textViewContent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    mImageButtonLoad <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ImageButton<span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">imageButtonLoad</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    mImageButtonLoad.<span style="color: #006633;">setOnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">View</span>.<span style="color: #006633;">OnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
      @Override
      <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span> v<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
          mUri <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #009900;">&#40;</span>mEditTextUrl.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000000; font-weight: bold;">new</span> UrlLoadTask<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>mUri<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>URISyntaxException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">class</span> UrlLoadTask <span style="color: #000000; font-weight: bold;">extends</span> AsyncTask<span style="color: #339933;">&lt;</span>URI, <span style="color: #003399;">Void</span>, JSONObject<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onPreExecute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      mProgressDialog <span style="color: #339933;">=</span> ProgressDialog.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span>JSONViewerActivity.<span style="color: #000000; font-weight: bold;">this</span>, <span style="color: #0000ff;">&quot;&quot;</span>,
          <span style="color: #0000ff;">&quot;Loading. Please wait...&quot;</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> JSONObject doInBackground<span style="color: #009900;">&#40;</span>URI... <span style="color: #006633;">uris</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        HttpClient client <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DefaultHttpClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        HttpGet get <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpGet<span style="color: #009900;">&#40;</span>uris<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        HttpResponse response <span style="color: #339933;">=</span> client.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>get<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        JSONObject jso <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JSONObject<span style="color: #009900;">&#40;</span>EntityUtils.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span>response
            .<span style="color: #006633;">getEntity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>jso<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>ClientProtocolException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">ParseException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>JSONException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onPostExecute<span style="color: #009900;">&#40;</span>JSONObject jso<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jso <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
          mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>jso.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>JSONException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        mTextViewContent.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      mProgressDialog.<span style="color: #006633;">dismiss</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><em>JSONViewer/src/de.mgsimon.android.jsonviewer/JSONViewerActivity.java</em></p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2011/11/10/android-und-json-jsonviewer-ein-beispiel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Motorola Milestone &amp; Froyo</title>
		<link>http://mgsimon.de/2011/03/18/motorola-milestone-froyo/</link>
		<comments>http://mgsimon.de/2011/03/18/motorola-milestone-froyo/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 20:36:38 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Mobil]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Froyo]]></category>
		<category><![CDATA[Milestone]]></category>
		<category><![CDATA[Motorola]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2979</guid>
		<description><![CDATA[Das lang ersehnte Update der Milestone Geschichte kann aktuell durch die Update-Software von Motorola unter Windows &#252;ber das USB-Kabel installiert werden. Motorola Milestone meets Android Froyo &#8230; Acht Dialogfenster unter Windows und drei Neustarts auf dem Milestone sp&#228;ter erstrahlt der kleine Stein mit der Firmware-Version 2.2.1 (Froyo). Ein kleiner Schritt f&#252;r das Milestone, ein riesiger [...]]]></description>
			<content:encoded><![CDATA[<p>Das lang ersehnte Update der Milestone Geschichte kann aktuell durch die <a href="http://direct.motorola.com/GER/SoftwareUpdateSummary.asp?country=DEU&#038;language=GER&#038;web_page_name=SUPPORT&#038;strCarrierId=&#038;strPhone=MILESTONE&#038;strCable=Micro%20USB%20Data%20Cable&#038;strURL=https://rsddownload.motorola.com/download/Motorola_MILESTONE_MR2.5_Release_Notes_Final.pdf">Update-Software von Motorola</a> unter Windows &#252;ber das USB-Kabel installiert werden.<br />
<div id="attachment_2983" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/03/MotorolaMilestoneSWUpdateInProgress.png" alt="Motorola Milestone :: SW Update In progress ..." title="Motorola Milestone :: SW Update In progress ..." width="442" height="265" class="size-full wp-image-2983 stamp" /><p class="wp-caption-text">Motorola Milestone :: SW Update In progress ...</p></div><br />
Motorola Milestone meets Android Froyo &#8230;</p>
<p><span id="more-2979"></span>Acht Dialogfenster unter Windows und drei Neustarts auf dem Milestone sp&#228;ter erstrahlt der kleine Stein mit der Firmware-Version 2.2.1 (Froyo).</p>
<div id="attachment_2986" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2011/03/MotorolaMilestoneTelefoninfo22.png" alt="Motorola Milestone :: Telefoninfo 2.2" title="Motorola Milestone :: Telefoninfo 2.2" width="442" height="786" class="size-full wp-image-2986 stamp" /><p class="wp-caption-text">Motorola Milestone :: Telefoninfo 2.2</p></div>
<p>Ein kleiner Schritt f&#252;r das Milestone, ein riesiger Schritt f&#252;r Motorola &#8230; </p>
<ul>
<li>mobile Hotspot
</li>
<li>Flash
</li>
<li>JIT
</li>
<li>V8
</li>
<li>App2SD
</li>
<li>&#8230; </li>
</ul>
<p>@mobiflip / <a href="http://www.mobiflip.de/2011/03/android-2-2-froyo-fuer-das-motorola-milestone-wird-ab-sofort-ausgeliefert/">Android 2.2 Froyo f&#252;r das Motorola Milestone wird ab sofort ausgeliefert</a>: funktioniert o2 und frei &#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2011/03/18/motorola-milestone-froyo/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Android Emulator unter Mac OS X selbst erstellen</title>
		<link>http://mgsimon.de/2010/10/08/android-emulator-unter-mac-os-x-selbst-erstellen/</link>
		<comments>http://mgsimon.de/2010/10/08/android-emulator-unter-mac-os-x-selbst-erstellen/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 04:57:12 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mobil]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[MacOSX]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2745</guid>
		<description><![CDATA[Am Anfang war das Android-SDK, sp&#228;ter die Tiefen der Quellen und am Ende der selbst erstellte Emulator unter Mac OS X &#8230; Disk Image Disk Image &#8220;android.dmg&#8221; f&#252;r die Android-Quellen mit dem Festplatten-Dienstprogramm unter &#8220;Programme / Dienstprogramme&#8221; mit folgenden Optionen erstellen. Sichern unter: android.dmg Name: android Gr&#246;&#223;e: Eigene (10,24 GB) Format: Mac OS Extended (Gro&#223;- [...]]]></description>
			<content:encoded><![CDATA[<p>Am Anfang war das <a href="http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/">Android-SDK</a>, sp&#228;ter <a href="http://mgsimon.de/2010/09/19/android-und-die-tiefen-der-quellen/">die Tiefen der Quellen</a> und am Ende der selbst erstellte Emulator unter Mac OS X &#8230;<br />
<div id="attachment_2794" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/10/MacOSXBootAndroidEmulator.png" alt="Mac OS X :: Boot Android Emulator" title="Mac OS X :: Boot Android Emulator" width="442" height="323" class="size-full wp-image-2794 stamp" /><p class="wp-caption-text">Mac OS X :: Boot Android Emulator</p></div><br />
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter Mac OS X &#8211; 10.6.4 &#8211; Snow Leopard durchgef&#252;hrt.</div><span id="more-2745"></span></p>
<p><strong>Disk Image</strong></p>
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Warum ein Disk Image?<br />
Die Quellen der Android-Plattform enthalten Dateien mit gleichen Name, welche sich lediglich durch Gro&#223;- / Kleinschreibung unterscheiden. Mac OS X unterscheidet diese im Auslieferungszustand nicht.</div>
<p>Disk Image &#8220;android.dmg&#8221; f&#252;r die Android-Quellen mit dem Festplatten-Dienstprogramm unter &#8220;Programme / Dienstprogramme&#8221; mit folgenden Optionen erstellen.</p>
<ul>
<li>Sichern unter: android.dmg</li>
<li>Name: android</li>
<li>Gr&#246;&#223;e: Eigene (10,24 GB)</li>
<li>Format: Mac OS Extended (Gro&#223;- / Kleinschreibung und Journaled)</li>
</ul>
<p><div id="attachment_2780" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/10/MacOSXFestplattenDienstprogrammImageErstellen.png" alt="Mac OS X :: Festplatten-Dienstprogramm Image erstellen" title="Mac OS X :: Festplatten-Dienstprogramm Image erstellen" width="442" height="307" class="size-full wp-image-2780 stamp" /><p class="wp-caption-text">Mac OS X :: Festplatten-Dienstprogramm Image erstellen</p></div><br />
<strong>Xcode &#038; MacPorts</strong></p>
<p>Die aktuellen Versionen von <a href="http://developer.apple.com/">Xcode</a> und <a href="http://www.macports.org/install.php">MacPorts</a> herunterladen, installieren und wie folgt konfigurieren.</p>
<ul>
<li>In der Datei &#8220;~/.bash_profile&#8221; die Umgebungsvariable &#8220;PATH&#8221; f&#252;r die MacPorts und &#8220;repo&#8221; (Repository-Skript) erweitern.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">PATH=/opt/local/bin:~/bin:$PATH</pre></div></div>

<ul>
<li>Zus&#228;tzliche MacPorts Pakete u.a. f&#252;r die Versionsverwaltung Git installieren.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">gmake</span> libsdl git-core gnupg</pre></div></div>

<p><strong>Repository</strong></p>
<p>Das Repository-Skript installieren und auf dem erstellten Disk Image initialisieren. Die anschlie&#223;ende Synchronisation l&#228;dt bei einer 20 MB DSL Anbindung in ungef&#228;hr einer Stunde (64m22.741s) etwa vier GB Quellen herunter.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin
$ curl http:<span style="color: #000000; font-weight: bold;">//</span>android.git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>repo <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> a+x ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Volumes<span style="color: #000000; font-weight: bold;">/</span>android 
$ repo init <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>android.git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>manifest.git
$ repo <span style="color: #c20cb9; font-weight: bold;">sync</span></pre></div></div>

<p><strong>Make</strong></p>
<p>Die Quellen der Android Plattform k&#246;nnen mit einem einfachen &#8220;make&#8221; (ca. zwei Stunden (114m23.836s) Mac Book Pro 2.4 GHz) &#252;bersetzt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p><strong>Emulator</strong></p>
<p>Zu guter letzt kann der Emulator wie folgt gestartet werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ . build<span style="color: #000000; font-weight: bold;">/</span>envsetup.sh
$ lunch <span style="color: #000000;">1</span>
$ emulator</pre></div></div>

<div id="attachment_2787" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/10/MacOSXAndroidEmulator.png" alt="Mac OS X :: Android Emulator" title="Mac OS X :: Android Emulator" width="442" height="432" class="size-full wp-image-2787 stamp" /><p class="wp-caption-text">Mac OS X :: Android Emulator</p></div>
<p><strong>Und es l&#228;uft doch &#8230;</strong></p>
<p>Abweichend der Dokumentation auf <a href="http://source.android.com/source/download.html">source.android.com</a> k&#246;nnen die aktuellen Android Quellen auch unter Snow Leopard &#252;bersetzt werden. :-)</p>
<blockquote><p>At the moment MacOS 10.6 (&#8220;Snow Leopard&#8221;) is not supported.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/10/08/android-emulator-unter-mac-os-x-selbst-erstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android und die Tiefen der Quellen</title>
		<link>http://mgsimon.de/2010/09/19/android-und-die-tiefen-der-quellen/</link>
		<comments>http://mgsimon.de/2010/09/19/android-und-die-tiefen-der-quellen/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 12:45:18 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[Mobil]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plattform]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2596</guid>
		<description><![CDATA[Das Android SDK mit den Android Development Tools (ADT) und Eclipse oder die Entwicklungsumgebung MOTODEV Studio for Android von Motorola erm&#246;glichen einen leichten Einstieg in die Anwendungsentwicklung f&#252;r Android, aber sp&#228;testens f&#252;r systemnahe Anwendungen sind diese Umgebungen nicht mehr ausreichend. Ein erster Versuch &#252;ber die Grenzen der eigenen Anwendung hinaus die Klassen der Android Plattform [...]]]></description>
			<content:encoded><![CDATA[<p>Das <a href="http://developer.android.com/sdk/index.html">Android SDK</a> mit den <a href="http://developer.android.com/sdk/eclipse-adt.html">Android Development Tools (ADT)</a> und <a href="http://www.eclipse.org/">Eclipse</a> oder die Entwicklungsumgebung <a href="http://developer.motorola.com/docstools/motodevstudio/">MOTODEV Studio for Android</a> von Motorola erm&#246;glichen einen leichten Einstieg in die Anwendungsentwicklung f&#252;r Android, aber sp&#228;testens f&#252;r systemnahe Anwendungen sind diese Umgebungen nicht mehr ausreichend.<br />
<div id="attachment_2685" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/MOTODEV_debug.png" alt="MOTODEV :: Debug" title="MOTODEV :: Debug" width="442" height="248" class="size-full wp-image-2685 stamp" /><p class="wp-caption-text">MOTODEV :: Debug</p></div><br />
Ein erster Versuch &#252;ber die Grenzen der eigenen Anwendung hinaus die Klassen der Android Plattform im Debugger zu analysieren &#8230; </p>
<p><span id="more-2596"></span><div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter <a href="http://www.ubuntu.com/desktop/get-ubuntu/download">Ubuntu 9.10 &#8211; Karmic Koala &#8211; 64-bit x86</a> mit der IDE <a href="http://developer.motorola.com/docstools/motodevstudio/download/">MOTODEV Studio for Android v1.3 (64-bit)</a> durchgef&#252;hrt.</div></p>
<p><strong>Entwicklungsumgebung Android Plattform</strong></p>
<p>erforderliche Pakete installieren</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openjdk-<span style="color: #000000;">6</span>-jdk git-core gnupg <span style="color: #c20cb9; font-weight: bold;">flex</span> <span style="color: #c20cb9; font-weight: bold;">bison</span> gperf build-essential <span style="color: #c20cb9; font-weight: bold;">zip</span> curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev</pre></div></div>

<p>Ubuntu X11 Workaround</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libX11.so.6 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libX11.so</pre></div></div>

<p>repo Skript installieren</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ curl http:<span style="color: #000000; font-weight: bold;">//</span>android.git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>repo <span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo</pre></div></div>

<p>Verzeichnis f&#252;r die lokalen Quellen erstellen</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Verzeichnis f&#252;r die Quellen initialisieren</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo init <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>android.git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>manifest.git</pre></div></div>

<p>Quellen herunterladen<br />
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Die <a href="http://android.git.kernel.org/">Quellen</a> der Android Plattform sind 4,1 GB und konnten mit meiner DSL Anbindung in gut 40 Minuten (39m8.564s) heruntergeladen werden.</div></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>repo <span style="color: #c20cb9; font-weight: bold;">sync</span></pre></div></div>

<p>Android Plattform &#252;bersetzen<br />
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Die 4,1 GB Quellen der Android Plattform konnte ich mit meinem Asus P50IJ in gut zwei Stunden (123m26.699s) &#252;bersetzen und wachsen auf etwa 8,1 GB an.</div></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p>Emulator starten</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master<span style="color: #000000; font-weight: bold;">/</span>
$ . build<span style="color: #000000; font-weight: bold;">/</span>envsetup.sh
$ lunch <span style="color: #000000;">1</span>
$ emulator</pre></div></div>

<p><div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Der Emulator wird gegens&#228;tzlich zum OS in der vertikalen Ausrichtung gestartet? Damit der Nacken nicht steif wird, kann die Ausrichtung des Emulators mit &lt;STRG&gt;+&lt;F11&gt; und &lt;STRG&gt;+&lt;F12&gt; ge&#228;ndert werden.</div><br />
<div id="attachment_2665" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/android_emulator_horizontal.png" alt="Android Plattform :: Emulator" title="Android Plattform :: Emulator" width="442" height="436" class="size-full wp-image-2665 stamp" /><p class="wp-caption-text">Android Plattform :: Emulator</p></div></p>
<p>Anwendung installieren (optional)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master<span style="color: #000000; font-weight: bold;">/</span>
$ . build<span style="color: #000000; font-weight: bold;">/</span>envsetup.sh
$ lunch <span style="color: #000000;">1</span>
$ adb <span style="color: #660033;">-s</span> emulator-<span style="color: #000000;">5554</span> <span style="color: #c20cb9; font-weight: bold;">install</span> MeineAnwendung.apk</pre></div></div>

<p><strong>Android Plattform &#038; MOTODEV Studio for Android</strong></p>
<p>Vorlage f&#252;r die Classpath-Konfiguration kopieren</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>android<span style="color: #000000; font-weight: bold;">/</span>android-master<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> development<span style="color: #000000; font-weight: bold;">/</span>ide<span style="color: #000000; font-weight: bold;">/</span>eclipse<span style="color: #000000; font-weight: bold;">/</span>.classpath .
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> u+<span style="color: #c20cb9; font-weight: bold;">w</span> .classpath</pre></div></div>

<p>In der IDE die Quellen der Android Plattform &#252;ber &#8220;File / New / Project&#8230; / Java / Java Project&#8221; und der &#8220;Use default loation&#8221; ge&#228;ndert auf &#8220;~/android/android-master&#8221; einbinden.<br />
<div id="attachment_2688" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/eclipse_new_java_project.png" alt="MOTODEV :: new Java Project" title="MOTODEV :: new Java Project" width="442" height="552" class="size-full wp-image-2688 stamp" /><p class="wp-caption-text">MOTODEV :: new Java Project</p></div><br />
<strong>Anwendung &#038; Android Plattform debuggen</strong></p>
<p>Die Quellen der eigenen Anwendung der Android Plattform &#252;ber Kontextmen&#252; &#8220;Build Path / Configure Build Path&#8230; / Projects / Add&#8230; / Select projects to add&#8221; hinzuf&#252;gen.</p>
<p>DDMS Perspektive &#246;ffnen und die VM der gestarteten Anwendung zum debuggen selektieren.<br />
<div id="attachment_2675" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/MOTODEV_DDMS.png" alt="MOTODEV :: DDMS" title="MOTODEV :: DDMS" width="442" height="248" class="size-full wp-image-2675 stamp" /><p class="wp-caption-text">MOTODEV :: DDMS</p></div></p>
<p>Zu guter letzt einen Breakpoint nach belieben setzen und &#252;ber Kontextmen&#252; auf das Projekt der Android Plattform &#8220;Debug As / Debug Configurations&#8230;&#8221; unter &#8220;Remote Java Application&#8221; eine neue Konfiguration mit folgenden Werten erstellen.</p>
<div id="attachment_2683" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/MOTODEV_debug_configuration.png" alt="MOTODEV :: Debug Configuration" title="MOTODEV :: Debug Configuration" width="442" height="354" class="size-full wp-image-2683 stamp" /><p class="wp-caption-text">MOTODEV :: Debug Configuration</p></div>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Host: localhost
Port: 8700</pre></div></div>

<p>&#220;ber Debug verbindet sich die IDE mit der im DDMS selektierten VM des Emulators und bei erreichen des Breakpoints kann in die Debug Perspektive gewechselt werden und bis in die Tiefen der Android Plattform Quellen Schritt f&#252;r Schritt vorgedrungen werden &#8230;</p>
<div id="attachment_2697" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/09/MOTODEV_confirm_perspective_switch.png" alt="MOTODEV :: Switch Perspective" title="MOTODEV :: Switch Perspective" width="442" height="208" class="size-full wp-image-2697 stamp" /><p class="wp-caption-text">MOTODEV :: Switch Perspective</p></div>
<p>Schon mal nicht schlecht &#8230; sch&#246;n w&#228;re noch eine bessere Integration des selbst erstellten Emulators in die IDE &#8230; ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/09/19/android-und-die-tiefen-der-quellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android und TiddlyWiki</title>
		<link>http://mgsimon.de/2010/07/04/android-und-tiddlywiki/</link>
		<comments>http://mgsimon.de/2010/07/04/android-und-tiddlywiki/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 11:48:50 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Mobil]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AndTidWiki]]></category>
		<category><![CDATA[TiddlyWiki]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2380</guid>
		<description><![CDATA[TiddlyWiki ist ein kompaktes in einer Datei sich selbst verwaltendes Wiki. Von einem mobilen Speichermedium wie USB-Stick oder SD-Card immer und &#252;berall in vielen Browser verf&#252;gbar. Aber wie sieht es mit TiddlyWiki und Android aus? Eines der Hauptprobleme ist das Speichern der Datei. TiddlyWiki verwendet f&#252;r die meisten Browser Workarounds, um Zugriff &#252;ber JavaScript auf [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tiddlywiki.com/">TiddlyWiki</a> ist ein kompaktes in einer Datei sich selbst verwaltendes Wiki. Von einem mobilen Speichermedium wie USB-Stick oder SD-Card immer und &#252;berall in vielen Browser verf&#252;gbar.<br />
<div id="attachment_2409" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/07/TiddlyWikiMozillaFirefox.png" alt="TiddlyWiki :: Mozilla Firefox" title="TiddlyWikiMozillaFirefox" width="442" height="299" class="size-full wp-image-2409 stamp" /><p class="wp-caption-text">TiddlyWiki :: Mozilla Firefox</p></div><br />
Aber wie sieht es mit <a href="http://tiddlywiki.com/">TiddlyWiki</a> und Android aus?</p>
<p><span id="more-2380"></span>Eines der Hauptprobleme ist das Speichern der Datei. <a href="http://tiddlywiki.com/">TiddlyWiki</a> verwendet f&#252;r die meisten Browser Workarounds, um Zugriff &#252;ber JavaScript auf das Dateisystem zu erhalten.<br />
</p>
<table width="100%">
<tr>
<th>Browser</th>
<th>Workaround</th>
</tr>
<tr>
<td>FireFox</td>
<td>JavaScript und PrivilegeManager</td>
</tr>
<tr>
<td>InternetExplorer</td>
<td>ActiveX</td>
</tr>
<tr>
<td>Chrome, Safari oder Opera</td>
<td>Applet</td>
</tr>
</table>
<p><center>Tabelle :: Workarounds</center></p>
<p>Im Browser unter Android funktioniert keine dieser Umgehungsl&#246;sungen.</p>
<p>Und es geht doch &#8230;</p>
<div id="attachment_2385" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/07/AndTidWiki_Save.png" alt="Android Tiddly Wiki :: Speichern" title="AndTidWiki_Save" width="442" height="248" class="size-full wp-image-2385 stamp" /><p class="wp-caption-text">Android Tiddly Wiki :: Speichern</p></div>
<p>&#8230; mit einer angepassten WebView &#228;hnlich dem Applet-Workaround funktioniert <a href="http://tiddlywiki.com/">TiddlyWiki</a> unter Android.</p>
<p>Die erste Testversion kann unter <a href="/android/andtidwiki">AndTidWiki</a> heruntergeladen werden.</p>
<p>Vielen Dank <a href="http://soup.information-architects.de/">SimonOX</a> f&#252;r die JavaScript-Unterst&#252;tzung &#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/07/04/android-und-tiddlywiki/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MOTODEV Studio for Android 64-bit</title>
		<link>http://mgsimon.de/2010/04/02/motodev-studio-for-android-64-bit/</link>
		<comments>http://mgsimon.de/2010/04/02/motodev-studio-for-android-64-bit/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 10:07:35 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2209</guid>
		<description><![CDATA[Die Entwicklungsumgebung f&#252;r Android besonders der Emulator ist unter Linux mit dem Workaround MOTODEV Studio for Android &#038; Ubuntu 64-Bit nicht wirklich schnell. Die aktuelle Version 1.2 wird in einer 64-bit Variante f&#252;r Linux zum Download unter MOTODEV Studio for Android v1.2 (64-bit) angeboten. Schneller, besser, stabiler &#8230; :-)]]></description>
			<content:encoded><![CDATA[<p>Die Entwicklungsumgebung f&#252;r Android besonders der Emulator ist unter Linux mit dem Workaround <a href="http://mgsimon.de/2010/01/23/motodev-studio-for-android-ubuntu-64-bit/">MOTODEV Studio for Android &#038; Ubuntu 64-Bit</a> nicht wirklich schnell. Die aktuelle Version 1.2 wird in einer 64-bit Variante f&#252;r Linux zum Download unter <a href="http://developer.motorola.com/docstools/motodevstudio/download/">MOTODEV Studio for Android v1.2 (64-bit)</a> angeboten. Schneller, besser, stabiler &#8230; :-)</p>
<div id="attachment_2215" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/04/MotoDevStudioAndroid64.png" alt="MOTODEV Studio for Android 64bit" title="MOTODEV Studio for Android 64bit" width="442" height="232" class="size-full wp-image-2215 stamp" /><p class="wp-caption-text">MOTODEV Studio for Android 64bit</p></div>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/04/02/motodev-studio-for-android-64-bit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Android und eBooks / Ubuntu und EPUB</title>
		<link>http://mgsimon.de/2010/01/24/android-und-ebooks-ubuntu-und-epub/</link>
		<comments>http://mgsimon.de/2010/01/24/android-und-ebooks-ubuntu-und-epub/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 09:20:25 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[eBook]]></category>
		<category><![CDATA[EPUB]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2144</guid>
		<description><![CDATA[Immer mehr elektronische B&#252;cher werden im weltweitem Netz angeboten. Galileo Press bietet zum Beispiel 25 IT-Fachb&#252;cher zum Download an. Man k&#246;nnte B&#252;cher unterwegs im Browser so lesen &#8230; &#8230; oder mit Calibre in das Format EPUB (electronic publication) konvertieren &#8230; &#8230; und angenehm mit einem eBook Reader auch offline lesen. eBook mit Calibre erstellen Die [...]]]></description>
			<content:encoded><![CDATA[<p>Immer mehr elektronische B&#252;cher werden im weltweitem Netz angeboten. Galileo Press bietet zum Beispiel <a href="http://www.galileocomputing.de/katalog/openbook">25 IT-Fachb&#252;cher</a> zum Download an.</p>
<p>Man k&#246;nnte B&#252;cher unterwegs im Browser so lesen &#8230;</p>
<div id="attachment_2173" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/01/BrowserEbook.png" alt="eBook :: Browser (Android)" title="BrowserEbook" width="442" height="248" class="size-full wp-image-2173 stamp" /><p class="wp-caption-text">eBook :: Browser (Android)</p></div>
<p>&#8230; oder mit Calibre in das Format EPUB (<strong>e</strong>lectronic <strong>pub</strong>lication) konvertieren &#8230;</p>
<p><span id="more-2144"></span><div id="attachment_2178" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/01/CalibreBibliothek.png" alt="Calibre :: Bibliothek" title="CalibreBibliothek" width="442" height="287" class="size-full wp-image-2178 stamp" /><p class="wp-caption-text">Calibre :: Bibliothek</p></div></p>
<p>&#8230; und angenehm mit einem eBook Reader auch <em>offline</em> lesen.</p>
<div id="attachment_2174" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/01/AndroidAppAldikoEbook.png" alt="eBook :: Aldiko" title="AndroidAppAldikoEbook" width="442" height="786" class="size-full wp-image-2174 stamp" /><p class="wp-caption-text">eBook :: Aldiko</p></div>
<p><strong>eBook mit Calibre erstellen</strong></p>
<p>Die Anwendung Calibre kann &#252;ber das Software-Center oder mit folgendem Befehl installiert und unter &#8220;Anwendungen / B&#252;ro / Calibre &#8230;&#8221; gestartet werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> calibre</pre></div></div>

<p>Das heruntergeladene eBook kann als Archiv &#252;ber &#8220;B&#252;cher hinzuf&#252;gen&#8221; in der Calibre Bibliothek aufgenommen werden und mit &#8220;In eBooks umwandeln&#8221; in das Format EPUB konvertiert werden.</p>
<p>Ohne Anpassungen im Quellmaterial noch nicht wirklich lesbar, aber einige regul&#228;re Ausdr&#252;cke sp&#228;ter und befreit von CSS ist das Ergebnis nach der Konvertierung brauchbar.</p>
<div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Die Option &#8220;Tabellen linearisieren&#8221; und die zus&#228;tzliche Angabe &#8220;body { word-wrap: break-word }&#8221; unter &#8220;Extra CSS&#8221; verhindern horizontales auslaufen.</div>
<p>Immer und &#252;berall B&#252;cher dabei &#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/01/24/android-und-ebooks-ubuntu-und-epub/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MOTODEV Studio for Android &amp; Ubuntu 64-Bit</title>
		<link>http://mgsimon.de/2010/01/23/motodev-studio-for-android-ubuntu-64-bit/</link>
		<comments>http://mgsimon.de/2010/01/23/motodev-studio-for-android-ubuntu-64-bit/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 08:48:42 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=2152</guid>
		<description><![CDATA[Die Entwicklungsumgebung MOTODEV Studio for Android bietet gegen&#252;ber der Erweiterung f&#252;r Eclipse von Google zus&#228;tzlich Code Snippets, Device Management, Market Publishing und einen Database Explorer. Wie im Blog Linux und Ich :: Android-SDK mit Bezug auf 64-bit Ubuntu und das Samsung Galaxy beschrieben funktioniert auch die Entwicklungsumgebung von Motorala unter Ubuntu 64-Bit nicht. MOTODEV Studio [...]]]></description>
			<content:encoded><![CDATA[<p>Die Entwicklungsumgebung <a href="http://developer.motorola.com/docstools/motodevstudio/download/">MOTODEV Studio for Android</a> bietet gegen&#252;ber der Erweiterung f&#252;r Eclipse von Google zus&#228;tzlich Code Snippets, Device Management, Market Publishing und einen Database Explorer.</p>
<div id="attachment_2155" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2010/01/MOTODEVStudioAndroid.png" alt="MOTODEV Studio for Android" title="MOTODEVStudioAndroid" width="442" height="225" class="size-full wp-image-2155 stamp" /><p class="wp-caption-text">MOTODEV Studio for Android</p></div>
<p>Wie im <a href="http://linuxundich.de/de/ubuntu/android-sdk-mit-bezug-auf-64-bit-ubuntu-und-das-samsung-galaxy/">Blog Linux und Ich :: Android-SDK mit Bezug auf 64-bit Ubuntu und das Samsung Galaxy</a> beschrieben funktioniert auch die Entwicklungsumgebung von Motorala unter Ubuntu 64-Bit nicht. </p>
<p>MOTODEV Studio for Android unter Ubuntu 64-Bit-Version &#8230;</p>
<p><span id="more-2152"></span>Damit die IDE auch unter der 64-Bit-Version funktioniert k&#246;nnte die Standard VM auf die 32-Bit Variante ge&#228;ndert werden &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--config</span> java</pre></div></div>

<p>&#8230; oder einfach die Entwicklungsumgebung mit folgendem Parameter gestartet werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>motodevstudio <span style="color: #660033;">-vm</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>ia32-java-<span style="color: #000000;">6</span>-sun<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>java</pre></div></div>

<div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" /><em>Warum die 64-Bit VM beibehalten?</em><br />
Ein &#8220;Suchen und Ersetzen&#8221; &#252;ber 300 Dateien in JEdit mit einem etwas komplexeren regul&#228;ren Ausdruck dauert mit der 32-Bit VM mehrere Minuten. Die OpenJDK 64-Bit Version ben&#246;tigt wenige Sekunden.</div>
<p><strong>Notizen</strong></p>
<p>Installation der 32-Bit virtual Machine.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ia32-sun-java6-bin</pre></div></div>

<p>Die installierten Varianten f&#252;r Java befinden sich unter /usr/lib/jvm/.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm
insgesamt <span style="color: #000000;">12</span>
... default-java -<span style="color: #000000; font-weight: bold;">&gt;</span> java-<span style="color: #000000;">6</span>-openjdk
... ia32-java-<span style="color: #000000;">6</span>-sun -<span style="color: #000000; font-weight: bold;">&gt;</span> ia32-java-<span style="color: #000000;">6</span>-sun-1.6.0.15
... ia32-java-<span style="color: #000000;">6</span>-sun-1.6.0.15
... java-1.6.0-openjdk -<span style="color: #000000; font-weight: bold;">&gt;</span> java-<span style="color: #000000;">6</span>-openjdk
... java-<span style="color: #000000;">6</span>-openjdk
... java-<span style="color: #000000;">6</span>-sun -<span style="color: #000000; font-weight: bold;">&gt;</span> java-<span style="color: #000000;">6</span>-sun-1.6.0.15
... java-<span style="color: #000000;">6</span>-sun-1.6.0.15</pre></div></div>

<p>Information der Standard VM anzeigen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ java <span style="color: #660033;">-version</span>
java version <span style="color: #ff0000;">&quot;1.6.0_0&quot;</span>
OpenJDK Runtime Environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>IcedTea6 1.6.1<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>6b16-1.6.1-3ubuntu1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
OpenJDK <span style="color: #000000;">64</span>-Bit Server VM <span style="color: #7a0874; font-weight: bold;">&#40;</span>build <span style="color: #000000;">14.0</span>-b16, mixed mode<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2010/01/23/motodev-studio-for-android-ubuntu-64-bit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Motorola Milestone und Dalvik Debug Monitor</title>
		<link>http://mgsimon.de/2009/12/23/motorola-milestone-und-dalvik-debug-monitor/</link>
		<comments>http://mgsimon.de/2009/12/23/motorola-milestone-und-dalvik-debug-monitor/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 11:10:51 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[ddms]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=1898</guid>
		<description><![CDATA[Das erste Beispiel oder die erste Android Anwendung ist fertig und kann einfach im virtuellem Ger&#228;t &#8220;Android Virtual Device&#8221; gestartet werden. Aber wie sieht es mit einem echten Ger&#228;t aus? Man k&#246;nnte die Anwendung als .apk (Android Application Package) exportieren und auf das Device kopieren, installieren und starten oder einfach &#252;ber die Android Debug Bridge [...]]]></description>
			<content:encoded><![CDATA[<p>Das erste Beispiel oder die erste Android Anwendung ist fertig und kann einfach im virtuellem Ger&#228;t &#8220;Android Virtual Device&#8221; gestartet werden. </p>
<p>Aber wie sieht es mit einem echten Ger&#228;t aus? </p>
<p>Man k&#246;nnte die Anwendung als .apk (Android Application Package) exportieren und auf das Device kopieren, installieren und starten oder einfach &#252;ber die Android Debug Bridge direkt aus Eclipse heraus Anwendungen nicht nur starten sondern auch gleich debuggen.</p>
<div id="attachment_1911" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/DalvikDebugMonitorMotorolaMilestone.png" alt="Dalvik Debug Monitor :: Motorola Milestone" title="DalvikDebugMonitorMotorolaMilestone" width="442" height="251" class="size-full wp-image-1911 stamp" /><p class="wp-caption-text">Dalvik Debug Monitor :: Motorola Milestone</p></div>
<p>Android SDK, Eclipse und ein echtes Device, das <a href="http://www.motorola.com/Consumers/DE-DE/Consumer-Products-and-Services/Mobile-Phones/ci.Motorola-MILESTONE-DE-DE.alt">Milestone von Motorola</a> &#8230;</p>
<p><span id="more-1898"></span><div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Das folgende Beispiel wurde unter Ubuntu Karmic Koala 9.10 und einer Entwicklungsumgebung f&#252;r Android durchgef&#252;hrt. Die Einrichtung einer Entwicklungsumgebung f&#252;r Android unter Linux ist im Artikel <a href="http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/">Hello World Android unter Linux</a> beschrieben.</div></p>
<p><strong>Motorola Milestone</strong></p>
<p>Auf dem Android Device USB-Debugging aktivieren.</p>
<ul>
<li>Unter &#8220;Einstellungen / Anwendungen / Entwicklung&#8221; USB-Debugging aktivieren.</li>
</ul>
<p><strong>Linux</strong></p>
<p>In der Shell die Ger&#228;te ID ermitteln.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ lsusb</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Bus 001 Device 004: ID 22b8:41db Motorola PCS</pre></div></div>

<p>udev-Regel f&#252;r das Ger&#228;t erstellen.</p>
<ul>
<li>Folgende Zeile in einer udev-Regel Konfiguration eintragen.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SUBSYSTEM==&quot;usb&quot;, SYSFS{idVendor}==&quot;22b8&quot;, MODE=&quot;0666&quot;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>udev<span style="color: #000000; font-weight: bold;">/</span>rules.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">51</span>-android.rules</pre></div></div>

<ul>
<li>Lesende Zugriffsberechtigung auf die neue Regeldatei setzen.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> a+r <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>udev<span style="color: #000000; font-weight: bold;">/</span>rules.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">51</span>-android.rules</pre></div></div>

<ul>
<li>Die Debug Bridge (adb) sollte &#252;ber folgenden Aufruf das Ger&#228;t auflisten.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">&lt;</span>sdk<span style="color: #000000; font-weight: bold;">&gt;/</span>tools<span style="color: #000000; font-weight: bold;">/</span>adb devices</pre></div></div>

<p><strong>Dalvik Debug Monitor</strong></p>
<p>Erster Test mit dem Dalvik Debug Monitor (ddms).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">&lt;</span>sdk<span style="color: #000000; font-weight: bold;">&gt;/</span>tools<span style="color: #000000; font-weight: bold;">/</span>ddms</pre></div></div>

<div style="background-color: rgb(191, 255, 191); border:1px solid rgb(128, 255, 128); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/tip.png" alt="Tipp" title="Tipp" width="24" height="24" style="margin: 4px 8px 0 0; float:left;" />Wird das Device nicht erkannt hilft ein Neustart der Android Debug Bridge. ($ &lt;sdk&gt;/adb kill-server)</div>
<p>Funktioniert die Debug Bridge k&#246;nnen Screenshots &#252;ber &#8220;Device / Screen capture&#8230;&#8221; erstellt werden.</p>
<div id="attachment_1913" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/MotorolaMilestoneStartBildschirm.png" alt="Motorola Milestone :: Startbildschirm" title="MotorolaMilestoneStartBildschirm" width="442" height="786" class="size-full wp-image-1913 stamp" /><p class="wp-caption-text">Motorola Milestone :: Startbildschirm</p></div>
<p>Was f&#252;r eine Aufl&#246;sung! :-)</p>
<p><strong>Eclipse</strong></p>
<p>In Eclipse die Anwendung auf dem externen Ger&#228;t zum debuggen starten.</p>
<ul>
<li>Anwendung in der Konfiguationsdatei AndroidManifest.xml unter &#8220;Application&#8221; &#8220;debugable&#8221; auf &#8220;true&#8221; setzen.</li>
<li>Kontextmen&#252; auf das Projekt und &#8220;Debug As / 1 Android Application&#8221; ausw&#228;hlen.</li>
</ul>
<div id="attachment_1921" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/EclipseDebugHelloWorldMotorolaMilstone.png" alt="Eclipse Debug - HelloWorld :: Motorola Milstone" title="EclipseDebugHelloWorldMotorolaMilstone" width="442" height="251" class="size-full wp-image-1921 stamp" /><p class="wp-caption-text">Eclipse Debug - HelloWorld :: Motorola Milstone</p></div>
<p><strong>Fertig</strong></p>
<p>Jetzt fehlt nur noch eine Idee f&#252;r eine sch&#246;ne Anwendung, aber vielleicht habe ich ja schon die eine oder andere &#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2009/12/23/motorola-milestone-und-dalvik-debug-monitor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello World Android unter Linux</title>
		<link>http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/</link>
		<comments>http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:18:39 +0000</pubDate>
		<dc:creator>mg</dc:creator>
				<category><![CDATA[Linux & Unix]]></category>
		<category><![CDATA[uup]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://mgsimon.de/?p=1835</guid>
		<description><![CDATA[Android ist ein Betriebssystem sowie auch eine Software-Plattform f&#252;r mobile Ger&#228;te auf Basis der Linux-Kernel Version 2.6. Ein gro&#223;er Teil der Software ist frei und quelloffen. Ein Grund sich die M&#246;glichkeiten der Entwicklung unter Linux kurz anzusehen. :-) Ein erstes Android-Programm &#8220;Hello World&#8221; im Android Virtual Device unter Linux kurz notiert &#8230; Android SDK Das [...]]]></description>
			<content:encoded><![CDATA[<p>Android ist ein Betriebssystem sowie auch eine Software-Plattform f&#252;r mobile Ger&#228;te auf Basis der Linux-Kernel Version 2.6. Ein gro&#223;er Teil der Software ist frei und quelloffen. Ein Grund sich die M&#246;glichkeiten der Entwicklung unter Linux kurz anzusehen. :-)</p>
<div id="attachment_1863" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/EclipseHelloWorldAndroid.png" alt="Eclipse :: Hello World Android" title="EclipseHelloWorldAndroid" width="442" height="251" class="size-full wp-image-1863 stamp" /><p class="wp-caption-text">Eclipse :: Hello World Android</p></div>
<p>Ein erstes Android-Programm &#8220;Hello World&#8221;  im Android Virtual Device unter Linux kurz notiert &#8230;</p>
<p><span id="more-1835"></span><strong>Android SDK</strong></p>
<p>Das Android Software Development Kit herunterladen und installieren.</p>
<ul>
<li>Android SDK f&#252;r Linux (i386) von <a href="http://developer.android.com/intl/en/sdk/index.html">http://developer.android.com/intl/en/sdk/index.html</a> herunterladen.</li>
<li>Heruntergeladenes Archiv entpacken und Ausf&#252;hrungsrechte auf die Dateien unter Tools setzen.</li>
</ul>
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Die Angabe &lt;sdk&gt; bezieht sich auf das Stammverzeichnis des entpackten Android SDKs (Bsp.: &#8230;/android-sdk-linux_86/).</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz android-sdk_r04-linux_86.tgz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">&lt;</span>sdk<span style="color: #000000; font-weight: bold;">&gt;/</span>
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> +x tools<span style="color: #000000; font-weight: bold;">/*</span></pre></div></div>

<p><strong>Eclipse</strong></p>
<p>Die Entwicklungsumgebung Eclipse installieren.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> eclipse</pre></div></div>

<ul>
<li>Eclipse starten (Entwicklung / Eclipse).</li>
</ul>
<div style="background-color: rgb(191, 228, 255); border:1px solid rgb(128, 201, 255); color: rgb(0, 0, 0); margin:0 0 1.5em; overflow:auto; padding: 3px;">
<img src="/wp-content/plugins/MyShortCodes/info.png" alt="Hinweis" title="Hinweis" width="24" height="24" style="margin: 4px 8px 0 0; float:left;"/>Die Eclipse Version unter Ubuntu Karmic Koala 9.10 wird ohne Softwarequellen von Eclipse installiert. Referenzen zu notwendigen Paketen der Erweiterung ADT k&#246;nnen nicht aufgel&#246;st werden.<br />
L&#246;sung: Site von Eclipse hinzuf&#252;gen.</div>
<ul>
<li>In Eclipse unter Help &#8220;Install new Software &#8230;&#8221; selektieren.</li>
<li>Im Dialogfenster &#8220;Install&#8221; Button &#8220;Add&#8230;&#8221; ausw&#228;hlen.</li>
<li>Dialog &#8220;Add Site&#8221; mit folgenden Werten &#252;ber Button OK best&#228;tigen.
<ul>
<li>Name: Eclipse</li>
<li>Location: http://download.eclipse.org/releases/galileo/</li>
</ul>
</li>
</ul>
<p><strong>Android Development Tools (ADT)</strong></p>
<p>Die Erweiterung Android Development Tools (ADT) f&#252;r Eclipse installieren.</p>
<ul>
<li>In Eclipse unter Help &#8220;Install new Software &#8230;&#8221; selektieren.</li>
<li>Im Dialogfenster &#8220;Install&#8221; Button &#8220;Add&#8230;&#8221; ausw&#228;hlen.</li>
<li>Dialog &#8220;Add Site&#8221; mit folgenden Werten &#252;ber Button OK best&#228;tigen.
<ul>
<li>Name: Android Plugin</li>
<li>Location: https://dl-ssl.google.com/android/eclipse/</li>
</ul>
</li>
<li>Zur&#252;ck im Dialogfenster &#8220;Install&#8221; die Checkbox &#8220;Developer Tools&#8221; ausw&#228;hlen und &#252;ber &#8220;Next >&#8221; best&#228;tigen.</li>
<li>Dialogfenster &#8220;Install Details&#8221; &#252;ber &#8220;Next >&#8221; best&#228;tigen.</li>
<li>Die Lizenzbedingungen im Dialogfenster &#8220;Review Licenses&#8221; best&#228;tigen und &#252;ber &#8220;Finish&#8221; die Installation beenden.
</li>
<li>Sicherheitswarnung &#252;ber den Button OK best&#228;tigen.</li>
<li>Eclipse durch &#8220;Yes&#8221; neu starten.</li>
</ul>
<p><strong>Android Plattform</strong></p>
<p>Android Plattformen durch das &#8220;android tool&#8221; im Verzeichnis &lt;sdk&gt;/tools/ dem SDK hinzuf&#252;gen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">&lt;</span>sdk<span style="color: #000000; font-weight: bold;">&gt;/</span>
$ tools<span style="color: #000000; font-weight: bold;">/</span>android</pre></div></div>

<div id="attachment_1871" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/AndroidSDKundAVDVerwaltung.png" alt="Android :: SDK und AVD Verwaltung" title="AndroidSDKundAVDVerwaltung" width="442" height="242" class="size-full wp-image-1871 stamp" /><p class="wp-caption-text">Android :: SDK und AVD Verwaltung</p></div>
<ul>
<li>&#8220;Force https://&#8230; sources to be fetched using http://&#8230;&#8221; unter &#8220;Settings&#8221; aktivieren und &#252;ber &#8220;Save &#038; Apply&#8221; speichern.</li>
<li>Gew&#252;nschte Plattformen und Pakete ausw&#228;hlen und &#252;ber &#8220;Install Selected&#8221; installieren.</li>
<li>Lizenzbedingungen best&#228;tigen und Installation &#252;ber &#8220;Install Accepted&#8221; starten.</li>
<li>Die Best&#228;tigung der Installation zus&#228;tzlicher SDK Komponenten durch &#8220;Close&#8221; beenden und das &#8220;android tool&#8221; Fenster schlie&#223;en.</li>
</ul>
<p><strong>Eclipse und Android SDK</strong></p>
<p>Das Android SDK Verzeichnis in Eclipse einstellen.</p>
<ul>
<li>In Eclipse unter &#8220;Window&#8221; &#8220;Preferences&#8221; ausw&#228;hlen.</li>
<li>Im Konfigurationsdialog &#8220;Preferences&#8221; unter &#8220;Android / SDK Location&#8221; das Android SDK Verzeichnis eintragen und &#252;ber OK best&#228;tigen.</li>
</ul>
<p><strong>Android Virtual Device (AVD)</strong></p>
<p>Android Virtual Device (AVD) mit dem Tool &#8220;android&#8221; erzeugen.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">&lt;</span>sdk<span style="color: #000000; font-weight: bold;">&gt;/</span>
$ tools<span style="color: #000000; font-weight: bold;">/</span>android create avd <span style="color: #660033;">--target</span> <span style="color: #000000;">2</span> <span style="color: #660033;">--name</span> my_avd</pre></div></div>

<p><strong>Hello World Android</strong></p>
<p>In Eclipse ein neues Projekt &#8220;Hello World&#8221; erstellen.</p>
<ul>
<li>In Eclipse &#8220;File / New / Project&#8221; ausw&#228;hlen.</li>
<li>Im Dialogfenster &#8220;New Project&#8221; ein Android Projekt unter &#8220;Android / Android Project&#8221; ausw&#228;hlen und &#252;ber &#8220;Next >&#8221; die Erstellung starten.</li>
<li>Das Projekt mit folgenden Werten &#252;ber &#8220;Finish&#8221; erzeugen.
<ul>
<li>Project name: HelloWorld</li>
<li>Application name: Hello, World</li>
<li>Package name: tld.meinedom&#228;ne.android.example.helloworld</li>
<li>Create Activity: HelloWorld</li>
<li>Min SDK Version: 2</li>
</ul>
</li>
<li>Die Klasse HelloWorld.java im Package Explorer unter src/Package name/HelloWorld.java um folgenden Quelltext erg&#228;nzen.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">de.mgsimon.android.example.helloworld</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloWorld <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
   <span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span>
   @Override
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       TextView tv <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TextView<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       tv.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello World&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       setContentView<span style="color: #009900;">&#40;</span>tv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<ul>
<li>Programm &#8220;HelloWorld&#8221; &#252;ber &#8220;Run / Run&#8221; starten.</li>
<li>&#8220;Android Application&#8221; ausw&#228;hlen und durch Ok ausf&#252;hren.</li>
</ul>
<div id="attachment_1864" class="wp-caption alignnone" style="width: 452px"><img src="http://mgsimon.de/wp-content/uploads/2009/12/AndroidVirtualDeviceHelloWorldAndroid.png" alt="Android Virtual Device (AVD) :: Hello World Android" title="AndroidVirtualDeviceHelloWorldAndroid" width="442" height="359" class="size-full wp-image-1864 stamp" /><p class="wp-caption-text">Android Virtual Device (AVD) :: Hello World Android</p></div>
<p><strong>Fertig</strong></p>
<p>Im Android Virtual Device wird die erste Anwendung &#8220;HelloWorld&#8221; gestart.</p>
<p>Weitere Informationen &#252;ber das Android SDK sind auf den Seiten von <a href="http://www.android.com/index.html">android.com</a> unter Developers. Viel Spasssss &#8230; :)</p>
]]></content:encoded>
			<wfw:commentRss>http://mgsimon.de/2009/12/19/hello-world-android-unter-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

