Acquisition and display of GPS signals on Android platform (3) configuration and simulator settings

Source: Internet
Author: User

1. In addition to the preceding Java module code, you must modify the permissions in the androidmanifest. xml file:

In uses-permission, the Code is as follows:

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="zfy.mygps"      android:versionCode="1"      android:versionName="1.0">    <uses-sdk android:minSdkVersion="8" />    <application android:icon="@drawable/icon" android:label="@string/app_name"    android:debuggable="true">        <activity android:name=".Mygps"                  android:label="@string/app_name"                  android:screenOrientation="portrait">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>     </application>       <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />     <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/></manifest>

2. If you want to run in the simulator, you also need the simulator to support GPS, which may not be enabled when you enable the simulator. The simulator's support for GPS is as follows:

In eclipse: Window ---> Android SDK and AVD manager. Open the simulator Management window. If there is an available simulator, open edit. If not, create a new simulator, for example:

In the window on the right of hardware, You can see whether GPS is supported. If not, click New on the right to bring up the following window:

Select the GPS support and exit.

In this way, the simulator supports GPS. You can use the simulator to test your program,

3. Use emulator control in eclipse to test positioning;

Window --> show View --> emulator control (if there is no emulator control in show view, it is in the other menu). If the simulator is not enabled, the emulator control is gray and cannot be edited, if the simulator is gray after it is enabled, restart eclipse (do not turn off the simulator)


Some information on the Internet said that GPS is supported only in android2.2 or below, and has passed tests in android2.2 and android2.3.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.