Calling NetworkInterface.getNetworkInterfaces() got Exception on Android SDK 0.9 and 1.0

by [EMAIL PROTECTED] » Fri, 26 Sep 2008 17:11:55 GMT


Sponsored Links
 Who knows what caused this issue when running on Android 0.9 and
1.0 ?

When I call this Java SE API

Enumeration nis = NetworkInterface.getNetworkInterfaces();

I always got below exception caused by the native method
getNetworkInterfacesImpl. Is that an android SDK's bug?

 java.net.SocketException: unkown error
  at java.net.NetworkInterface.getNetworkInterfacesImpl(Native Method)
  at
java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:
297)


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



Other Threads

1. Youtube streaming via Emulator "does not work"



The qualifier here is "via an Android Emulator", streaming YouTube
works fine on the real devices. The emulator does not support the UDP
networking required for the RTSP:// streams that YouTube offers.

There are other options (should you need to support the emulator). You
could use the video ID to extract a playback token, and use YouTube's
/get_video request to pull the 3GP file format from YouTube's server
and play that. An example of this approach (including Java code) can
be found here: 
http://keyeslabs.com/joomla/index.php/blogs/i-think-im-becoming-an-android/51-polish-your-app-free-embeddable-android-youtube-activity.
There are other benefits to this, such as not requiring a good quality
network connection to play the video.

For example, this works for me:

public class TestActivitySnapshot extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        streamYoutubeVideo();
    }

    private void streamYoutubeVideo() {
        VideoView video = (VideoView)findViewById(R.id.video_view);

        // "token" value retrieved from
http://www.youtube.com/get_video_info?&video_id=ghIoTW10qwc

        video.setVideoURI(Uri.parse("http://www.youtube.com/get_video?" +
                                "video_id=ghIoTW10qwc" + /* YouTube video ID */
                                
"&t=vjVQa1PpcFMQUzL0L4TXtChsSDb2hogA4XEbSjFRf9U%3D" + /* "token" value */
                                "&fmt=17")); /* 17 = low quality, 18 = high 
quality */
                
        video.start();
    }
}

--

2. How to request finish composing text from custom View?

Hi,

I am writing custom text edit control. I implemented InputConnection
interface and receive input method changes from it. But when I move cursor
in my custom text editor, I want to tell Input method to finish composing of
text. This is the behavior of EditText widget. How to implement it in my
control.

Kaloyan

-- 

3. how to change window z-order on-the-fly

4. Problem while sending and receiving SMS

5. Controlling Activity Animation

6. Youtube streaming via Emulator "does not work"

7. Mobile Ad Networks - Recommendations