Android Location API - Simple Location: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 4: | Zeile 4: | ||
1. Android Projekt erstellen Name: Simple Location | 1. Android Projekt erstellen Name: Simple Location | ||
== Permissions == | == Permissions == | ||
| + | Zum manifest.xml hinzufügen: | ||
* INTERNET | * INTERNET | ||
* ACCESS_FINE_LOCATION | * ACCESS_FINE_LOCATION | ||
* ACCESS_COARSE_LOCATION | * ACCESS_COARSE_LOCATION | ||
| + | |||
| + | <pre> | ||
| + | <uses-permission android:name="android.permission.INTERNET"/> | ||
| + | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> | ||
| + | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> | ||
| + | </pre> | ||
== Layout == | == Layout == | ||
Version vom 7. Oktober 2013, 14:57 Uhr
Einleitung
Projekt
1. Android Projekt erstellen Name: Simple Location
Permissions
Zum manifest.xml hinzufügen:
- INTERNET
- ACCESS_FINE_LOCATION
- ACCESS_COARSE_LOCATION
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dip"
android:orientation="horizontal" >
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="5dip"
android:text="Latitude: "
android:textSize="20dip" >
</TextView>
<TextView
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="unknown"
android:textSize="20dip" >
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginRight="5dip"
android:text="Longitute: "
android:textSize="20dip" >
</TextView>
<TextView
android:id="@+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="unknown"
android:textSize="20dip" >
</TextView>
</LinearLayout>
</LinearLayout>