Hi,

I am repeatedly getting "02-28 06:16:40.267: DEBUG/SntpClient(66):
request time failed: java.net.SocketException: Address family not
supported by protocol" in my Sudoku program. Also my program doesn't
proceed from these statements even after 5 hours.My files are the same
as given in Ed Burnette's book.
My files are
1. main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   >
<TextView
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/main_title"
   />
   <Button
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/continue_label"/>
   <Button
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/new_game_label"/>
   <Button
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/about_label"/>
   <Button
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/exit_label"/>

</LinearLayout>

2.strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
   <string name="app_name">Sudoku</string>
   <string name="main_title">AndroidSudoku</string>
   <string name="continue_label">Continue</string>
   <string name="new_game_label">New Game</string>
   <string name="about_label">About</string>
   <string name="exit_label">Exit</string>
</resources>


3.AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
     package="org.example.sudoku"
     android:versionCode="1"
     android:versionName="1.0">
   <uses-sdk android:minSdkVersion="8" />

   <application android:icon="@drawable/icon" android:label="@string/
app_name">
       <activity android:name=".Sudoku"
                 android:label="@string/app_name">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category
android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>

   </application>
</manifest>

4.Sudoku.java
package org.example.sudoku;

import android.app.Activity;
import android.os.Bundle;

public class Sudoku extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
   }
}


5. My logCat is:
02-28 05:49:05.238: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 05:49:05.409: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 05:51:39.978: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 05:56:40.007: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:01:40.027: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:06:40.107: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:11:40.139: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:12:00.658: DEBUG/dalvikvm(66): GC_FOR_MALLOC freed 15329
objects / 647896 bytes in 463ms
02-28 06:16:40.267: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:21:40.297: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:26:40.367: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:31:40.467: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:36:40.577: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:38:36.677: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 06:38:36.758: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 06:38:37.007: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 06:38:37.148: DEBUG/KeyguardViewMediator(66): pokeWakelock(5000)
02-28 06:39:00.538: DEBUG/dalvikvm(66): GC_FOR_MALLOC freed 15023
objects / 615448 bytes in 423ms
02-28 06:41:40.678: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:46:40.688: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:51:40.767: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 06:56:40.847: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:01:40.917: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:05:42.987: DEBUG/dalvikvm(182): GC_FOR_MALLOC freed 9917
objects / 473592 bytes in 360ms
02-28 07:06:40.946: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:08:00.658: DEBUG/dalvikvm(66): GC_FOR_MALLOC freed 15507
objects / 636304 bytes in 485ms
02-28 07:11:41.047: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:16:41.136: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:21:41.248: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol
02-28 07:26:41.307: DEBUG/SntpClient(66): request time failed:
java.net.SocketException: Address family not supported by protocol


please please help.


On 2/28/11, Nick Pelly <[email protected]> wrote:
> Hi Dave,
>
> Correct, we do not support Card Emulation in the SDK. It's actually very
> hard to do this in a consistent way across the Android platform, due to the
> current hardware architecture of NFC. Different NFC hardware can
> support Card Emulation in very different ways, to the point where its very
> hard to design a useful and consistent API.
>
> Peer-to-peer is the way to go. We have just one API call for this now -
> NfcAdapter.enableForegroundNdefPush() but it is surprisingly powerful.
>
> Nick
>
>
> On Fri, Feb 25, 2011 at 9:33 AM, davemac <[email protected]> wrote:
>
>> I'm no NFC guru, but from what I can tell of the docs and the samples,
>> there's no way to do card emulation on an Android device at this time,
>> using the SDK. Is that correct?
>>
>> I see the published classes/methods for reading/writing tags, and for
>> the Ndef push using P2P and the mysterious com.android.npp package
>> (anyone know where there's more information on that?). But that
>> doesn't get me to turning the Android device into whatever tag I want
>> it to be read as by some other NFC reader, at least I'm pretty sure it
>> doesn't. Unless the NFC sensor reads and writes my device's tag if
>> there happens to be one on the device. Is that how it's supposed to
>> work? If that last part is true, is there some sort of convention on
>> how I recognize "my" tag as compared to any other tag I come into
>> contactless with?
>>
>> I saw posts describing how to do this from the NDK level but I'm
>> asking about from the SDK level. I also saw source code with
>> unpublished methods for card emulation, which leads me to believe that
>> it's just not possible, yet.
>>
>> Thanks for any help on this.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to