java.net.BindException: Permissions do not allow action on socket

by sharon....@gmail.com » Sat, 14 Mar 2009 14:56:30 GMT


Sponsored Links
 I can not find answer from android-disc...@googlegroups.com, so post
here again.

The java.net.BindException happened when I tried to new MulticastSocket
(223). It should be because the port 223 is lower than 1024.  I tried
with a normal Java application (not Android), the socket can be
created successfully.  So, this access control should only be from
Android platform.

 Is there any way to use the socket port lower than 1024 in Android?
My application has to use this port to receive data from other
official/commercial tool which I can not change. I've added INTERNET
permission and I can create the socket successfully if I change it to
other port bigger than 1023.
--~--~---------~--~----~------------~-------~--~----~



java.net.BindException: Permissions do not allow action on socket

by Jean-Baptiste Queru » Sat, 14 Mar 2009 15:06:39 GMT


 We normally prefer to keep this groups for discussions about changes
in Android that affect application writers. Android-developers might
have been a more appropriate group for your question, though this is
the right place to discuss how to improve the situation.

The short answer is: yes, Android applications can't access ports
lower than 1024. That's a bit of an unfortunate situation. I don't
believe that there's been any change in that area between the original
release and the latest source code.

I believe that one of the open questions is to decide whether access
to low ports should be granted under the regular internet permission,
whether a separate permission should cover all the low ports, or
whether the low ports should be individually covered by separate
permissions (in which case the list of such ports and the way they're
grouped would have to be decided).

JBQ

On Sat, Mar 14, 2009 at 7:56 AM, sharon....@gmail.com





-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


java.net.BindException: Permissions do not allow action on socket

by sharon....@gmail.com » Sat, 14 Mar 2009 15:32:46 GMT


 Is there any workaround I can do to use port 223 at the moment?  Will
this exception happen if I run my application as root?  Is it possible
runing my application ( myapp.apk) as root ? Thanks.




--~--~---------~--~----~------------~-------~--~----~



java.net.BindException: Permissions do not allow action on socket

by Jean-Baptiste Queru » Sat, 14 Mar 2009 15:47:58 GMT


 You'd have to run as root, but that's not possible. Very little of the
system runs as root (in fact even the system server itself, which is
the core of the android runtime, doesn't run as root).

JBQ

On Sat, Mar 14, 2009 at 8:32 AM, sharon....@gmail.com







-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~---------~--~----~------------~-------~--~----~



java.net.BindException: Permissions do not allow action on socket

by sharon....@gmail.com » Sat, 14 Mar 2009 16:29:27 GMT


  got your point.  I will try other way to get my result.

I hope your raised open question can be addressed in this forum and it
can be closed soon to provide a convenient way for developer for some
specific purpose.

On Mar 14, 11:47pm, Jean-Baptiste Queru <j...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Vertex Array/Vertex Buffer Objects driver bug on Droid

Hi,

just wanted to drop by to tell you about a nice little bug i just
encountered on my droid. Here's some sample code:

        @Override
        public void render(Application app)
        {
                GL11 gl = app.getGraphics().getGL11();

                gl.glViewport( 0, 0, app.getGraphics().getWidth(),
app.getGraphics().getHeight() );
                gl.glClearColor( 0.7f, 0.7f, 0.7f, 1 );
                gl.glClear( GL11.GL_COLOR_BUFFER_BIT );

                gl.glBindBuffer( GL11.GL_ARRAY_BUFFER, vboHandle );
                gl.glEnableClientState( GL11.GL_VERTEX_ARRAY );
                gl.glEnableClientState( GL11.GL_COLOR_ARRAY );
                gl.glVertexPointer( 3, GL11.GL_FLOAT, 6 * 4, 0 );
                gl.glColorPointer( 3, GL11.GL_FLOAT, 6 * 4, 3 * 4 );
                gl.glDrawArrays( GL11.GL_TRIANGLES, 0, 3 );
        }

        @Override
        public void setup(Application app)
        {
                ByteBuffer buffer = ByteBuffer.allocateDirect( 3 * 6 * 4 );
                buffer.order(ByteOrder.nativeOrder());
                FloatBuffer vertices = buffer.asFloatBuffer();
                vertices.put( new float[] {
                                        -0.5f, -0.5f, 0, 1, 0, 0,
                                         0.5f, -0.5f, 0, 0, 1, 0,
                                         0.0f,  0.5f, 0, 0, 0, 1,
                });
                vertices.flip();

                GL11 gl = app.getGraphics().getGL11();
                int[] handle = new int[1];
                gl.glGenBuffers( 1, handle, 0 );
                vboHandle = handle[0];
                gl.glBindBuffer( GL11.GL_ARRAY_BUFFER, vboHandle );
                gl.glBufferData( GL11.GL_ARRAY_BUFFER, 3 * 6 * 4, vertices,
GL11.GL_STATIC_DRAW );
                gl.glBindBuffer( GL11.GL_ARRAY_BUFFER, 0 );
        }

In the setup method i create a FloatBuffer holding three vertices,
each having 3 coordinates (x,y,z) and 3 color components (r,g,b). Next
i generate a vertex buffer object to store the vertex data in. As you
can see the vertex data is interleaved, so everything goes into a
single VBO.

In the render method i set the viewport and clear the screen first.
Next i bind the VBO and set the vertex and color pointer to start at
the correct positions in the interleaved vertex data in the VBO. This
code works perfectly fine on the desktop.

On my Droid it crashes horribly in glDrawArrays with  a segfault. I
triple-checked everything i did with the OpenGL ES specs and i came to
the conclusion that i'm not doing anything wrong (also, as i said it
works on the desktop). By accident i changed the number of color
components from 3 to 4 (r,g,b,a) and finally it worked.

This seems like a bug in the Motorola Droid PowerVR drivers. Can
anyone confirm this?

-- 

2. gimana dapaetkan android-app di situs ini ?

guyss, ada app di situs http://www.androiddbms.com/ ....
katanya free, cuma nggak tahu caranya dimana downloadnya.

pliss help

--
"Indonesian Android Community [id-android]"

3. Narsis sore2....

4. apps di istore

5. Case utk spica

6. Help hero ngehang

7. is there a way to get a view to the front?