android-developers
[Arriba] [Todas las Listas]

Re: [android-developers] IllegalState Cuándo creando interfaz con Andro

To: android-developers@xxxxxxxxxxxxxxxx
Subject: Re: [android-developers] IllegalState Cuándo creando interfaz con Android 4.0 VpnService.Constructor
From: James Black <planiturthian@xxxxxxxxx>
Date: Wed, 30 Nov 2011 15:07:42 -0500
Delivery-date: Wed, 30 Nov 2011 15:08:10 -0500
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:in-reply-to:references:date :message-id:subject:from:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=81eK4kq9r0eFz9hTN8xDU474aYL7hlgvmkafQb5trRc=; b=tyB08rmfl3hzapqKq+ZuCmh+QttLWY8zO1KC+mV+COaLByQPiEiG62sFcWazbbEb2F YR8ptZ4FrZlfyz/iAMeCTOv2joNxsNzG2ex6Vd9+9mCumUTc06j7zO5fikcNxgc4ZcfD 6eJ7IFYJEwnFJ0Vm1krccAZx7fau4POe+pu8A=
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <0222b65f-6fec-47d6-9de9-420e25098919@w1g2000vba.googlegroups.com>
List-archive: <http://groups.google.com/group/android-developers?hl=en_US>
List-help: <http://groups.google.com/support/?hl=en_US>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <http://groups.google.com/group/android-developers/post?hl=en_US>, <mailto:android-developers@googlegroups.com>
List-subscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <http://groups.google.com/group/android-developers/subscribe?hl=en_US>, <mailto:android-developers+unsubscribe@googlegroups.com>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
References: <0222b65f-6fec-47d6-9de9-420e25098919@w1g2000vba.googlegroups.com>
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
Es vuestro código que corre en el *UI hilo?

En *Wed, *Nov 30, 2011 en 1:14 PM, Kristian <kristian.evensen@xxxxxxxxx>escribió:

> Hola,
>
> soy *experimenting con el *VpnService que era añadió a *Android en
> SDK 4.0. He conseguido tan lejos cuando empezando el *VpnService, aun así, soy incapaz de crear la interfaz virtual. Mi código echa un
> *IllegalStateException y no soy capaz de imaginar fuera de por qué.
>
> Mi corte abajo el ejemplo parece esto:
>
>                        *ParcelFileDescriptor *pfd = *null;
>
>                        *VpnService.Constructor *b = nuevo *VpnService.Constructor();
>                        prueba
>                                #unknown{^*b.*addAddress("10.0.6.2", 24);
>                                *b.*setMtu(1460);
>                                *b.*setSession("*TunnelTest");
>                        } Coge(*IllegalArgumentException *e)
>                                #unknown{^*Log.*v("Servicio", "la Dirección es nula!");
>                                *stopSelf();
>                                Regreso;
>                        }
>
>                        prueba
>                                #unknown{^*pfd = *b.Establece();
>                        } coge (*IllegalArgumentException *e)
>                                #unknown{^*Log.*v("Servicio", "la Interfaz fue proporcionada
> con un argumento
> ilegal");
>                        } coge (*IllegalStateException *e)
>                                #unknown{^*e.*printStackTrace();
>                                *Log.*v("Servicio", "estado Ilegal");
>                        } coge (*SecurityException *e)
>                                #unknown{^*Log.*v("Servicio", "excepción de Seguridad
> echada");
>
> Qué intento hacer aquí es para crear una interfaz virtual con IP
> 10.0.6.2, perteneciendo al 10.6.0.0/24 *subnet. La excepción es echada
> por el *b.Establece() llamada.
>
> Esto es el lleno *stack rastro:
>
>        11-30 17:51:10.863: *W/Sistema.*err(2741):
> *java.*lang.*IllegalStateException: No puede crear interfaz
>        11-30 17:51:10.875: *W/Sistema.*err(2741):         en
> *android.*os.*Parcel.*readException(*Parcel.*java:1335)
>        11-30 17:51:10.875: *W/Sistema.*err(2741):         en
> *android.*os.*Parcel.*readException(*Parcel.*java:1281)
>        11-30 17:51:10.875: *W/Sistema.*err(2741):         en
> *android.Red.*IConnectivityManager$Colilla
> $*Proxy.*establishVpn(*IConnectivityManager.*java:1321)
>        11-30 17:51:10.875: *W/Sistema.*err(2741):         en
> *android.Red.*VpnService
> $Constructor.Establece(*VpnService.*java:472)
>        11-30 17:51:10.875: *W/Sistema.*err(2741):         en
> ningún.*simtel.*TestVpnService
> $*TestVpn.Carrera(*TestVpnService.*java:37)
>
> *Thanks anticipadamente para cualquier ayuda.
>
> /Kristian
>
> --
> recibiste este mensaje porque eres *subscribed al *Google
> Grupos "*Android *Developers" grupo.
> A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx
> A *unsubscribe de este grupo, envía *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx
> 
> Puesto que más opciones, visita este grupo en
> *http://grupos.*google.*com/Grupo/*android-*developers?*hl=*en




-- 
"Sé que te crees entiende lo que piensas que dije, pero no soy
seguro realizas que lo que oiste no es qué signifiqué."
- Robert *McCloskey

-- 
recibiste este mensaje porque eres *subscribed al *Google
Grupos "*Android *Developers" grupo.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx
A *unsubscribe de este grupo, envía *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx

Puesto que más opciones, visita este grupo en
*http://grupos.*google.*com/Grupo/*android-*developers?*hl=*en
Is your code running on the UI thread?

On Wed, Nov 30, 2011 at 1:14 PM, Kristian <kristian.evensen@xxxxxxxxx>wrote:

> Hello,
>
> I am experimenting with the VpnService that was added to Android in
> SDK 4.0. I have gotten as far as starting the VpnService, however, I
> am unable to create the virtual interface. My code throws an
> IllegalStateException and I am not able to figure out why.
>
> My cut down example looks like this:
>
>                        ParcelFileDescriptor pfd = null;
>
>                        VpnService.Builder b = new VpnService.Builder();
>                        try{
>                                b.addAddress("10.0.6.2", 24);
>                                b.setMtu(1460);
>                                b.setSession("TunnelTest");
>                        } catch(IllegalArgumentException e){
>                                Log.v("Service", "Address is invalid!");
>                                stopSelf();
>                                return;
>                        }
>
>                        try{
>                                pfd = b.establish();
>                        } catch (IllegalArgumentException e){
>                                Log.v("Service", "Interface was provided
> with an illegal
> argument");
>                        } catch (IllegalStateException e){
>                                e.printStackTrace();
>                                Log.v("Service", "Illegal state");
>                        } catch (SecurityException e){
>                                Log.v("Service", "Security exception
> thrown");
>
> What I try to do here is to create a virtual interface with IP
> 10.0.6.2, belonging to the 10.6.0.0/24 subnet. The exception is thrown
> by the b.establish() call.
>
> This is the full stack trace:
>
>        11-30 17:51:10.863: W/System.err(2741):
> java.lang.IllegalStateException: Cannot create interface
>        11-30 17:51:10.875: W/System.err(2741):         at
> android.os.Parcel.readException(Parcel.java:1335)
>        11-30 17:51:10.875: W/System.err(2741):         at
> android.os.Parcel.readException(Parcel.java:1281)
>        11-30 17:51:10.875: W/System.err(2741):         at
> android.net.IConnectivityManager$Stub
> $Proxy.establishVpn(IConnectivityManager.java:1321)
>        11-30 17:51:10.875: W/System.err(2741):         at
> android.net.VpnService
> $Builder.establish(VpnService.java:472)
>        11-30 17:51:10.875: W/System.err(2741):         at
> no.simtel.TestVpnService
> $TestVpn.run(TestVpnService.java:37)
>
> Thanks in advance for any help.
>
> /Kristian
>
> --
> 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@xxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@xxxxxxxxxxxxxxxx
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
"I know that you believe you understand what you think I said, but I'm not
sure you realize that what you heard is not what I meant."
- Robert McCloskey

-- 
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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
<Anterior por Tema] Tema Actual [Siguiente por Tema>