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. Bls: WTA : Galaxy Tab. Worth It ?

Di update aja bro :-d

-- 
===============

2. [Copas] Perbandingan MicroSDHC Class 10

Copas dari Ju Ming..
Semoga info ini bermanfaat :)
========================== 

Karena penasaran maka saya coba 2 buah MicroSDHC 16GB Class 10 yang saat ini
dianggap tercepat. Kedua pesertanya adalah AData dan Team, dimana secara
spesifikasi keduanya mempunyai kemampuan yang sama.

Saya menggunakan sebuah media card reader USB yang kecil untuk hardware,
sedangkan software hanya menggunakan HD-Tach 3.0.1.0 di Windows Vista.

Berikut ini adalah hasil testnya:

Team
- Short sample
* Burst transfer rate: 19.4 MB/s
* Access time: 1.2 ms
* Average transfer rate: 18.4 MB/s
- Long sample:
* Burst transfer rate: 20.3 MB/s
* Access time: 1.2 ms
* Average transfer rate: 18.4 MB/s

AData
- Short sample
* Burst transfer rate: 18.1 MB/s
* Access time: 0.8 ms
* Average transfer rate: 16.7 MB/s
- Long sample:
* Burst transfer rate: 19 MB/s
* Access time: 0.9 ms
* Average transfer rate: 16.7 MB/s

Melihat hasil test diatas, perbedaan keduanya memang tidak signifikan,
tetapi terlihat AData unggul di akses time, sedangkan Team lebih unggul di
transfer rate, sehingga untuk keperluan sehari-hari Team lebih cocok bila
dipasangkan ke camera digital yang kemampuannya tinggi, supaya bisa
mengakomodasi penyimpanan data berukuran besar dengan cepat, sebaliknya
untuk AData lebih sesuai bila dipasangkan dengan smartphone yang systemnya
didominasi file-file berukuran kecil namun jumahnya banyak.

Nexian Journey
Phantom King Skyfish

-- 
===============

3. oot Gmail Motion Exists, Just Not Done by Google

4. New Devloper - Need help with the most basic, Hello World!

5. custom dialog frame - how to get a pointy triangle edge

6. Detecting horizontal movement of phone

7. Backup Manager Error