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. How should I call an application from another application?

use intents...
before usin modify ur  manifest file
On Sat, May 23, 2009 at 10:00 AM, iou200...@gmail.com




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

2. InflateException

Hello,

I've been having some trouble.  What I'm trying to do is retrieve data
from the database and display it in a ListView, but keep getting this
error:


05-22 20:22:19.215: ERROR/AndroidRuntime(776): Uncaught handler:
thread main exiting due to uncaught exception
05-22 20:22:19.266: ERROR/AndroidRuntime(776):
android.view.InflateException: Binary XML file line #17: Error
inflating class Textview
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:575)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.inflate(LayoutInflater.java:407)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.ResourceCursorAdapter.newView
(ResourceCursorAdapter.java:79)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.CursorAdapter.getView(CursorAdapter.java:182)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.AbsListView.obtainView(AbsListView.java:1269)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.ListView.makeAndAddView(ListView.java:1623)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.ListView.fillDown(ListView.java:607)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.ListView.fillFromTop(ListView.java:664)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.ListView.layoutChildren(ListView.java:1481)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.AbsListView.onLayout(AbsListView.java:1113)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.View.layout(View.java:6133)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.onLayout(LinearLayout.java:918)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.View.layout(View.java:6133)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.View.layout(View.java:6133)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.LinearLayout.onLayout(LinearLayout.java:918)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.View.layout(View.java:6133)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.widget.FrameLayout.onLayout(FrameLayout.java:333)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.View.layout(View.java:6133)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.ViewRoot.performTraversals(ViewRoot.java:929)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.os.Handler.dispatchMessage(Handler.java:99)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.os.Looper.loop(Looper.java:123)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
java.lang.reflect.Method.invoke(Method.java:521)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
dalvik.system.NativeStart.main(Native Method)
05-22 20:22:19.266: ERROR/AndroidRuntime(776): Caused by:
java.lang.ClassNotFoundException: android.view.Textview in loader
dalvik.system.pathclassloa...@43594028
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.createView(LayoutInflater.java:465)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.onCreateView(LayoutInflater.java:543)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView
(PhoneLayoutInflater.java:66)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
05-22 20:22:19.266: ERROR/AndroidRuntime(776):     ... 34 more


Thanks for the help.


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

3. i see the list has gone crazy again

4. Camera preview callback and garbage collector

5. Data Typists Needed ! Work from home, Great Income!

6. obtener el aparato liberado en chile?

7. Okay, so we don't put ListView in ScrollView. Now what? (2nd attempt)