سؤال

i need your assistance for my problem. I created an Android application that work perfectly on virtual devices

But when i try to run it on my Samsung Galaxy s2 it just stop working without showing no errors on the LogCat

N.B : this application need internet to work

Here is the AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.rats"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="10" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.rats.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.rats.LineActivity"
            android:label="@string/title_activity_line" >
        </activity>
    </application>

</manifest>

I just found the relevant error, which is =>

01-26 20:12:25.285: E/AccuWeather - UALib(8131): IOException when executing request. Do you have permission to access the internet? (device-api.urbanairship.com)

but i dont understand why, at my manifest.xml i activated the access to the internet

هل كانت مفيدة؟

المحلول

Just add:

  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

to your manifest

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top