Hi all,

I'm happy to join in this group; i'm new on Android apps, and hope I can
share with community a lot!

This is my first question to group (I apologize for large email in a first
time...):
I making a little Activity that connect in network and (will) make OSC
connection <http://opensoundcontrol.org/introduction-osc>;
in onResume() the Activity check Network/OSC connections, and start a
AlertDialog
if necessary.

When the Activity try make an OSC connection (see code below), LogCat
receive Error messages;
OSC accpet UDP connections, but i don't know what is happening...

05-25 10:32:22.026: ERROR/FaderAcivityTest(321): Unable to establish a
connection->
05-25 10:32:22.026: ERROR/FaderAcivityTest(321): java.net.SocketException:
Permission denied (maybe missing INTERNET permission)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
org.apache.harmony.luni.platform.OSNetworkSystem.createDatagramSocketImpl(Native
Method)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
org.apache.harmony.luni.platform.OSNetworkSystem.createDatagramSocket(OSNetworkSystem.java:155)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
org.apache.harmony.luni.net.PlainDatagramSocketImpl.create(PlainDatagramSocketImpl.java:149)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
java.net.DatagramSocket.createSocket(DatagramSocket.java:198)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
java.net.DatagramSocket.<init>(DatagramSocket.java:84)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
java.net.DatagramSocket.<init>(DatagramSocket.java:68)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
com.illposed.osc.OSCPortOut.<init>(Unknown Source)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
com.illposed.osc.OSCPortOut.<init>(Unknown Source)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
gml.android.surround.osc.CheckConnectivity.makeOSCPortOut(CheckConnectivity.java:64)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
gml.android.surround.FaderActivityTest.onResume(FaderActivityTest.java:156)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.Activity.performResume(Activity.java:3763)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1889)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.os.Handler.dispatchMessage(Handler.java:99)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.os.Looper.loop(Looper.java:123)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
java.lang.reflect.Method.invoke(Method.java:521)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-25 10:32:22.026: ERROR/FaderAcivityTest(321):     at
dalvik.system.NativeStart.main(Native Method)
05-25 10:48:14.791: INFO/dalvikvm(321): Debugger has detached; object
registry had 492 entries
05-25 10:48:15.887: DEBUG/ddm-heap(321): Got feature list request

The code above returns an OSCPortOut
:<http://www.illposed.com/software/javaosc.html>
    /**
     *  Return an OscPortOut; null if error occured;
     * @param ip
     * @param port
     * @return
     */
    public static OSCPortOut makeOSCPortOut(String ip, int port, String
activityTag){
        try {
            InetAddress net = InetAddress.getByName(ip);
            return new OSCPortOut(net);
        } catch (UnknownHostException uhe) {
            Log.e(activityTag, "Unable to establish a connection->", uhe);
            return null;
        } catch (SocketException se) {
            Log.e(activityTag, "Unable to establish a connection-> ", se);
            return null;
        }
    }

And AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
      package="gml.android.surround"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="7" />
    <uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>

    <application android:icon="@drawable/icon"
android:label="@string/app_name">
        <activity android:label="@string/app_name"
android:name=".FaderActivityTest">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".OSCEditActivity"
android:label="@string/app_osc_name"></activity>

    </application>
</manifest>

Thanks!

-- 
-- 

GUILHERME

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to