Hi Kostya,

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 1 hour.My files are the same
as given in Ed Burnette's book.

My LogCat is:
03-01 02:02:53.252: DEBUG/AndroidRuntime(282): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
03-01 02:02:53.263: DEBUG/AndroidRuntime(282): CheckJNI is ON
03-01 02:02:55.381: DEBUG/AndroidRuntime(282): --- registering native
functions ---
03-01 02:03:01.543: INFO/ActivityManager(69): Start proc
com.android.defcontainer for service
com.android.defcontainer/.DefaultContainerService: pid=289 uid=10010
gids={1015, 2001}
03-01 02:03:03.863: DEBUG/dalvikvm(289): GC_EXPLICIT freed 768
objects / 55584 bytes in 298ms
03-01 02:03:04.762: DEBUG/PackageParser(69): Scanning package: /data/
app/vmdl67559.tmp
03-01 02:03:05.693: INFO/PackageManager(69): Removing non-system
package:org.example.sudoku
03-01 02:03:05.743: INFO/ActivityManager(69): Force stopping package
org.example.sudoku uid=10037
03-01 02:03:06.403: DEBUG/PackageManager(69): Scanning package
org.example.sudoku
03-01 02:03:06.461: INFO/PackageManager(69): Package
org.example.sudoku codePath changed from /data/app/
org.example.sudoku-2.apk to /data/app/org.example.sudoku-1.apk;
Retaining data and using new
03-01 02:03:06.512: INFO/PackageManager(69): /data/app/
org.example.sudoku-1.apk changed; unpacking
03-01 02:03:06.681: DEBUG/installd(35): DexInv: --- BEGIN '/data/app/
org.example.sudoku-1.apk' ---
03-01 02:03:07.793: DEBUG/dalvikvm(298): DexOpt: load 259ms, verify
53ms, opt 12ms
03-01 02:03:07.881: DEBUG/installd(35): DexInv: --- END '/data/app/
org.example.sudoku-1.apk' (success) ---
03-01 02:03:07.923: WARN/PackageManager(69): Code path for pkg :
org.example.sudoku changing from /data/app/org.example.sudoku-2.apk
to /data/app/org.example.sudoku-1.apk
03-01 02:03:07.932: INFO/ActivityManager(69): Force stopping package
org.example.sudoku uid=10037
03-01 02:03:07.993: WARN/PackageManager(69): Resource path for pkg :
org.example.sudoku changing from /data/app/org.example.sudoku-2.apk
to /data/app/org.example.sudoku-1.apk
03-01 02:03:08.082: DEBUG/PackageManager(69):   Activities:
org.example.sudoku.Sudoku
03-01 02:03:08.771: INFO/installd(35): move /data/dalvik-cache/
data@[email protected]@classes.dex -> /data/dalvik-cache/
data@[email protected]@classes.dex
03-01 02:03:08.822: DEBUG/PackageManager(69): New package installed
in /data/app/org.example.sudoku-1.apk
03-01 02:03:09.872: INFO/ActivityManager(69): Force stopping package
org.example.sudoku uid=10037
03-01 02:03:10.811: DEBUG/dalvikvm(126): GC_EXPLICIT freed 177
objects / 7544 bytes in 327ms
03-01 02:03:11.712: INFO/ActivityManager(69): Start proc com.svox.pico
for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=300
uid=10028 gids={}
03-01 02:03:13.012: WARN/RecognitionManagerService(69): no available
voice recognition services found
03-01 02:03:14.872: DEBUG/dalvikvm(165): GC_EXPLICIT freed 4204
objects / 254440 bytes in 4142ms
03-01 02:03:14.913: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 8175
objects / 526176 bytes in 593ms
03-01 02:03:15.663: DEBUG/dalvikvm(69): GC_EXPLICIT freed 340
objects / 19648 bytes in 591ms
03-01 02:03:16.802: INFO/installd(35): unlink /data/dalvik-cache/
data@[email protected]@classes.dex
03-01 02:03:17.222: INFO/ActivityThread(300): Publishing provider
com.svox.pico.providers.SettingsProvider:
com.svox.pico.providers.SettingsProvider
03-01 02:03:17.691: DEBUG/AndroidRuntime(282): Shutting down VM
03-01 02:03:17.703: INFO/AndroidRuntime(282): NOTE: attach of thread
'Binder Thread #4' failed
03-01 02:03:17.783: DEBUG/dalvikvm(282): Debugger has detached; object
registry had 1 entries
03-01 02:03:20.482: DEBUG/AndroidRuntime(310): >>>>>>>>>>>>>>
AndroidRuntime START <<<<<<<<<<<<<<
03-01 02:03:20.482: DEBUG/AndroidRuntime(310): CheckJNI is ON
03-01 02:03:22.212: DEBUG/AndroidRuntime(310): --- registering native
functions ---
03-01 02:03:27.391: INFO/ActivityManager(69): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x10000000
cmp=org.example.sudoku/.Sudoku }
03-01 02:03:27.682: DEBUG/AndroidRuntime(310): Shutting down VM
03-01 02:03:27.801: DEBUG/dalvikvm(310): Debugger has detached; object
registry had 1 entries
03-01 02:03:27.833: INFO/AndroidRuntime(310): NOTE: attach of thread
'Binder Thread #3' failed
03-01 02:03:28.643: INFO/ActivityManager(69): Start proc
org.example.sudoku for activity org.example.sudoku/.Sudoku: pid=317
uid=10037 gids={}
03-01 02:03:32.933: INFO/ActivityManager(69): Displayed activity
org.example.sudoku/.Sudoku: 4761 ms (total 271945 ms)
03-01 02:03:33.001: INFO/ActivityManager(69): Displayed activity
com.android.launcher/com.android.launcher2.Launcher: 272056 ms (total
272056 ms)
03-01 02:03:38.872: DEBUG/dalvikvm(126): GC_EXPLICIT freed 676
objects / 38544 bytes in 683ms
03-01 02:05:57.952: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:10:58.002: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:16:01.153: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:21:01.332: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:26:01.402: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:30:40.433: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 16342
objects / 668376 bytes in 509ms
03-01 02:31:01.473: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:36:01.541: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:41:01.561: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:46:01.582: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:51:01.672: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 02:56:01.702: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:00:00.623: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 14932
objects / 608768 bytes in 464ms
03-01 03:01:01.781: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:06:01.803: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:11:01.841: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:16:01.901: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:18:37.041: DEBUG/dalvikvm(179): GC_FOR_MALLOC freed 9897
objects / 473400 bytes in 387ms
03-01 03:21:01.942: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:26:02.012: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:29:01.551: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 15105
objects / 615920 bytes in 1293ms
03-01 03:31:02.043: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol


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);
  }
}
Reply | Reply to all | Forward | Print | Delete | Show original

   nov <[email protected]>    Tue, Mar 1, 2011 at 4:56 AM
To: Android Developers <[email protected]>
Reply | Reply to all | Forward | Print | Delete | Show original
Somebody please help me out. My program is running for close to 3
hours and i am still getting  "DEBUG/SntpClient(69): request time
failed: java.net.SocketException: Address family not supported by
protocol" for Sudoku game.
- Show quoted text -
03-01 03:36:02.162: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:41:02.181: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:46:02.222: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:51:02.291: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:56:02.372: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 03:58:00.592: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 15551
objects / 638096 bytes in 505ms
03-01 04:01:02.411: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:06:02.512: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:11:02.562: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:16:02.642: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:21:02.703: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:26:02.791: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:27:00.863: DEBUG/dalvikvm(69): GC_FOR_MALLOC freed 15989
objects / 645800 bytes in 414ms
03-01 04:31:02.862: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:36:02.941: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol
03-01 04:41:03.042: DEBUG/SntpClient(69): request time failed:
java.net.SocketException: Address family not supported by protocol


On 3/1/11, Kostya Vasilyev <[email protected]> wrote:
> Robin,
>
> This blog post describes something pretty close to what I think you are
> trying to do:
>
> http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html
>
> -- Kostya
>
> 01.03.2011 21:34, Robin Talwar ?????:
>> Sorry couldnt manage to get the screenshot some problem in my sdk i guess.
>>
>> Though i can share the code of my list item
>>
>> package com.hungama.myplay.utils;
>>
>> import java.io.IOException;
>> import java.net.URL;
>>
>> import android.app.Activity;
>> import android.graphics.Bitmap;
>> import android.graphics.BitmapFactory;
>> import android.os.AsyncTask;
>> import android.util.AttributeSet;
>> import android.view.LayoutInflater;
>> import android.view.View;
>> import android.widget.ImageButton;
>> import android.widget.ImageView;
>> import android.widget.LinearLayout;
>> import android.widget.TextView;
>>
>> import com.hungama.myplay.activity.R;
>> import com.hungama.myplay.model.Album;
>> import com.hungama.myplay.model.Category;
>> import com.hungama.myplay.model.DownloadPlan;
>> import com.hungama.myplay.model.SearchElement;
>> import com.hungama.myplay.model.Track;
>> import com.hungama.myplay.model.VideoElement;
>>
>> public class ListItemView extends LinearLayout {
>>     private Activity activity;
>>     private Track track;
>>     private Album album;
>>     private Category category;
>>     private int resId;
>>     private ImageView iv_thumb;
>>     private VideoElement video;
>>     private int bgColor = -1;
>>     private SearchElement searchElement;
>>     private byte searchType;
>>     private boolean isPlaylistItem;
>>     private DownloadPlan plan;
>>
>>     public ListItemView(Activity context, AttributeSet attrs) {
>>         super(context, attrs);
>>         activity = context;
>>     }
>>
>>     public ListItemView(Activity context, int resId, Track track) {
>>         super(context);
>>         activity = context;
>>         this.track = track;
>>         this.resId = resId;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity context, int resId, Track track,
>>             boolean isPlaylistItem) {
>>         super(context);
>>         activity = context;
>>         this.track = track;
>>         this.resId = resId;
>>         this.isPlaylistItem = isPlaylistItem;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity context, int resId,
>>             SearchElement searchElement, byte searchType) {
>>         super(context);
>>         this.searchType = searchType;
>>         activity = context;
>>         this.searchElement = searchElement;
>>         this.resId = resId;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity context, int resId, Album album) {
>>         super(context);
>>         activity = context;
>>         this.album = album;
>>         this.resId = resId;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity context, int resId, VideoElement video) {
>>         super(context);
>>         activity = context;
>>         this.video = video;
>>         this.resId = resId;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity context, int resId, DownloadPlan plan) {
>>         super(context);
>>         activity = context;
>>         this.plan = plan;
>>         this.resId = resId;
>>
>>         addView(getListElementView());
>>     }
>>
>>     public ListItemView(Activity activity2, int listElementView, int grey,
>>             Category category2) {
>>         super(activity2);
>>         activity = activity2;
>>         this.category = category2;
>>         this.resId = listElementView;
>>         bgColor = grey;
>>
>>         addView(getListElementView());
>>     }
>>
>>     private View getListElementView() {
>>         LayoutInflater inflater = activity.getLayoutInflater();
>>         View ConvertView = inflater.inflate(resId, null);
>>         LinearLayout linearLayout = (LinearLayout) ConvertView
>>                 .findViewById(R.id.l_list_element_super_view);
>>         if (plan == null) {
>>             iv_thumb = (ImageView)
>> ConvertView.findViewById(R.id.iv_thumbnail);
>>             ImageButton imageButton = (ImageButton) ConvertView
>>                     .findViewById(R.id.imb_download);
>>             if (!isPlaylistItem) {
>>                 FetchImage fetchImage = new FetchImage();
>>                 fetchImage.execute();
>>             } else {
>>                 iv_thumb.setImageResource(R.drawable.music);
>>                 imageButton.setVisibility(View.GONE);
>>             }
>>             TextView tv_title = (TextView) ConvertView
>>                     .findViewById(R.id.tv_list_element_title);
>>             TextView tvSecondLine = (TextView) ConvertView
>>                     .findViewById(R.id.tv_list_element_album);
>>             if (this.track != null) {
>>                 TextView tv_albumName = (TextView) ConvertView
>>                         .findViewById(R.id.tv_list_element_album);
>>                 tv_albumName.setText(track.getAlbum());
>>                 if (track.getTitle() != null) {
>>                     tv_title.setText(track.getTitle());
>>                 }
>>                 if (track.getAlbum() != null) {
>>                     tvSecondLine.setText(track.getAlbum());
>>                 }
>>             } else if (this.album != null) {
>>
>>                 imageButton.setVisibility(View.GONE);
>>                 if (album.getAlbumName() != null) {
>>                     tv_title.setText(album.getAlbumName());
>>                 }
>>             } else if (this.category != null) {
>>                 tv_title.setText(category.getName());
>>                 imageButton.setVisibility(View.GONE);
>>             } else if (this.video != null) {
>>                 if (video.getTitle() != null) {
>>                     tv_title.setText(video.getTitle());
>>                 }
>>                 if (video.getAlbum() != null) {
>>                     tvSecondLine.setText(video.getAlbum());
>>                 }
>>             } else if (this.searchElement != null) {
>>
>>                 if (searchType == Constants.SEARCH_TRACK) {
>>                     tv_title.setText(searchElement.getTrackTitle());
>>                     if (searchElement.getAlbumTitle() != null) {
>>
>> tvSecondLine.setText(searchElement.getAlbumTitle());
>>                     }
>>                 } else if (searchType == Constants.SEARCH_ALBUM) {
>>                     imageButton.setVisibility(View.GONE);
>>                     tv_title.setText(searchElement.getAlbumTitle());
>>                     if (searchElement.getReleaseDate() != null) {
>>
>> tvSecondLine.setText(searchElement.getReleaseDate());
>>                     }
>>                 } else if (searchType == Constants.SEARCH_ARTIST) {
>>                     imageButton.setVisibility(View.GONE);
>>                     tv_title.setText(searchElement.getArtistTitle());
>>                 }
>>             }
>>
>>             // if (bgColor != -1) {
>>             // linearLayout.setBackgroundColor(bgColor);
>>             // }
>>         } else {
>>             TextView tv_title = (TextView) ConvertView
>>                     .findViewById(R.id.tv_name);
>> //            tv_title.setText(plan.getName());
>>             TextView tvSecondLine = (TextView) ConvertView
>>                     .findViewById(R.id.tv_desc);
>> //            tvSecondLine.setText(plan.getDescription());
>>         }
>>
>>         return linearLayout;
>>     }
>>
>>     class FetchImage extends AsyncTask<Void, Void, Byte> {
>>
>>         protected Byte doInBackground(Void... params) {
>>             URL uri = null;
>>             try {
>>                 if (track != null) {
>>                     if (track.getImageUrl() != null) {
>>                         uri = new URL(track.getImageUrl());
>>                     }
>>                 } else if (album != null) {
>>                     if (album.getImageUrl() != null) {
>>                         uri = new URL(album.getImageUrl());
>>                     }
>>                 } else if (category != null) {
>>                     if (category.getImage() != null) {
>>                         uri = new URL(category.getImage());
>>                     }
>>                 } else if (video != null) {
>>                     if (video.getImageUrl() != null) {
>>                         uri = new URL(video.getImageUrl());
>>                     }
>>                 } else if (searchElement != null
>> && searchElement.getImageUrl() != null
>> && !searchElement.getImageUrl()
>>                                 .equalsIgnoreCase("null")) {
>>                     uri = new URL(searchElement.getImageUrl());
>>                 }
>>                 if (uri != null) {
>>                     final Bitmap bitmap = BitmapFactory.decodeStream(uri
>>                             .openConnection().getInputStream());
>>                     if (bitmap != null) {
>>                         activity.runOnUiThread(new Runnable() {
>>
>>
>>                             public void run() {
>>                                 iv_thumb.setImageBitmap(bitmap);
>>                             }
>>                         });
>>
>>                     }
>>                 }
>>             } catch (IOException e) {
>>                 e.printStackTrace();
>>             }
>>             return null;
>>         }
>>     }
>> }
>>
>>
>> On Tue, Mar 1, 2011 at 7:49 PM, TreKing <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>>     On Tue, Mar 1, 2011 at 1:45 AM, Abhishek Talwar
>>     <[email protected]
>>     <mailto:[email protected]>> wrote:
>>
>>         Any help will be appreciated
>>
>>
>>     It will be very difficult to help you with such generic, limited
>>     information.
>>     Post a screenshot of the problem, clarify what the issue is, and
>>     show some relevant code.
>>
>>
>> -------------------------------------------------------------------------------------------------
>>     TreKing <http://sites.google.com/site/rezmobileapps/treking> -
>>     Chicago transit tracking app for Android-powered devices
>>
>>     --
>>     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]
>>     <mailto:[email protected]>
>>     To unsubscribe from this group, send email to
>>     [email protected]
>>     <mailto:android-developers%[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
>
>
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
>
> --
> 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