[android-developers] Missing or Incorrect images and backgrounds randomly throughout app lifecycle
I was hoping someone here might have an idea what causes this sort of behaviour: Throughout my application, in seemingly random places and in random conditions I'm observing this strange UI issue. Images are on occasion being loaded black (with the correct bounds) or with the incorrect image source (again, with the correct bounds). This effects `ImageViews` and has effected `android:background` tags with references to colour resources. My application relies on 6 library projects, it runs Native Code via a Service and Activities in the App use GlSurfaceViews (although, not all Activities which display the problem contain OpenGL components). The problem could I suppose be from any of these places or a combination of them through using large amounts of memory. You can see this behaviour in the following screen shots: * This is actually a 6 or so pixel wide column separator image which has been incorrectly drawn into my ImageView (the ImageView seems to have correctly sized itself). http://i.stack.imgur.com/fzfm9.png * When going out of the Application and then back in again (repeatedly) it instead appeared (and remained) like so: http://i.stack.imgur.com/ILEWB.png * After a Force Clear and a Clear App Data it returned to the correct format: http://i.stack.imgur.com/q4Xa4.png As you can also see the Magnifying Glass image next to it is displaying fine in each of these. The problems with these missing/incorrect images and backgrounds seems to happen randomly, throughout the application lifecycle, and I've been unable to find a way of reproducing it. The layouts for these images are nothing special, I'm not doing anything funny during the rendering lifecycle (i'm not overriding `onDraw()` or `onMeasure()` or the like). The source of these images aren't being set dynamically but via the XML. As you can see from the above example, it's not a build issue as it occurs between app lifecycles not between installs. It's also happening on different devices, Samsung 8.9, Acer Iconia Tab, Motarola XOOM, It seems to me to be some sort of error with the reference table, could it perhaps have been nudged by my native code? Or is it an effect of me in some stages of the application using too much memory? My question on SO has more examples including XML layouts: http://stackoverflow.com/questions/12562896/missing-or-incorrect-images-and-backgrounds-randomly-throughout-app-lifecycle Thanks for your help! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Missing, Incorrect ImageView/Backgrounds during program execution
Hello, I was hoping someone here might have an idea what causes this sort of behaviour: Throughout my application, in seemingly random places and in random conditions I'm observing this strange UI issue. Images are on occasion being loaded black (with the correct bounds) or with the incorrect image source. This effects ImageViews and has effected android:background tags with references to colour resources. My application relies on 6 library projects, it runs Native Code via a Service and Activities in the App use GlSurfaceViews (although, not all Activities which display the problem contain OpenGL components). The problem could I suppose be from any of these places or a combination of them through using large amounts of memory. You can see this behaviour in the following screen shots: This is actually a 6 or so pixel wide column separator image which has been incorrectly drawn into my ImageView (the ImageView seems to have correctly sized itself). http://i.stack.imgur.com/fzfm9.png When going out of the Application and then back in again (repeatedly) it instead appeared (and remained) like so: http://i.stack.imgur.com/ILEWB.png After a Force Clear and a Clear App Data it returned to the correct format: http://i.stack.imgur.com/q4Xa4.png As you can also see the Magnifying Glass image next to it is displaying fine in each of these. The problems with these missing/incorrect images and backgrounds seems to happen randomly, throughout the application and have yet been unable to find a way of reproducing it. The layouts for these images are nothing special, I'm not doing anything funny during the rendering lifecycle (i'm not overriding onDraw or onMeasure or the like). The source of these images aren't being set dynamically but via the XML tag. As you can see from the above example, it's not a build issue as it occurs between app lifecycles not between installs. It seems to me to be some sort of error with the reference table, could it perhaps have been nudged by my native code? Or is it an effect of me in some stages of the application using too much memory? I've got this question up on StackOverflow here: http://stackoverflow.com/questions/12562896/black-incorrect-blurred-or-torn-images-throughout-application where you can see the layout files and another example of this happening. Anyone seen this behaviour before? Graeme -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Want a background Service to show Toasts on Device Screen
Hi I have a background service component which is reacting to changes in network connectivity. I would like to alert the user that a a connectivity change event has occurred by popping up a Toast View on the device screen. Is this possible ? Can it be done even though a Service component does not have a UI associated with it ? Thanks for any pointers Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Can I force Android to open a network connection on a specified network interface/network type ?
Hi I have been looking at the ConnectivityManager class documented at http://developer.android.com/reference/android/net/ConnectivityManager.html . I would like to know if an Android application can open a network connection (socket) on a specified network interface [on a device supporting multiple network interface types WiFi, Cellular, WiMax etc] ? I am looking for the capability for an application to open a socket on a given type of network for example over WiFi network or over 3G Cellular Data network. If this is possible in Android, how would I code this requirement within the API Framework ? The ConnectivityManager enables an application to learn about available network connections and currently categorises them as either TYPE_WIFI or TYPE_MOBILE. There is a member function in the ConnectivityManager class called requestRouteToHost(int,int) [see http://developer.android.com/reference/android/net/ConnectivityManager.html#requestRouteToHost(int,%20int)] which "Ensure that a network route exists to deliver traffic to the specified host via the specified network interface. An attempt to add a route that already exists is ignored, but treated as successful." Sounds like this would install an IP routing table entry to reach a given host via a specified network interface type (WiFi or Mobile). After calling this would it be sufficient for an application to open a socket and connect to the desired destination address ? Or perhaps the application needs to bind() a socket to a local address of a network interface of the desired type (WiFi or Mobile) Or by setting a socket-level socket option of SO_DONTROUTE ? Any help would be appreciated Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] What are the Intents broadcast by the ConnectivityManager
Hi The ConnectivityManager is described at http://developer.android.com/reference/android/net/ConnectivityManager.html The Class Overview states that The primary responsibilities of this class are to: 2. Send broadcast intents when network connectivity changes What is/are the ACTION(s) of the Intents broadcast by a ConnectivityManager service/object ? Where are these documented ? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Dalvik Debug Monitor Sometimes Shows Multiple Devices (Sometimes!)
Hi Fedor No not at the moment. I admit I do run it sometimes. But the problem I'm describing seems to be connected with the ADP1 -- I seem to get multiple devices connected none of which work correctly with adb and ddms. Makes debugging a nightmare ! Rgds Graeme On Mar 3, 3:21 pm, Faber Fedor wrote: > Are you running the emulator? That counts as a "device". > > > > On Tue, Mar 3, 2009 at 9:48 AM, Graeme wrote: > > > Hi > > > I am seeing some problems when my ADP1 is connected via USB to my > > Windows dev machine (Win XP). > > I sometimes see multiple (usually two) devices in the Dalvik Debug > > Monitor. One of these devcies will disappear > > when I unplug the ADP1 but one will remain. This is making it rather > > difficult to install new vesrions of my application > > onto the ADP1. Is this a known problem ? Are there any known work- > > arounds ? > > > Thanks > > Graeme > > -- > > Faber Fedor > Linux New Jerseyhttp://linuxnj.com > faberfedor.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Dalvik Debug Monitor Sometimes Shows Multiple Devices (Sometimes!)
Hi I am seeing some problems when my ADP1 is connected via USB to my Windows dev machine (Win XP). I sometimes see multiple (usually two) devices in the Dalvik Debug Monitor. One of these devcies will disappear when I unplug the ADP1 but one will remain. This is making it rather difficult to install new vesrions of my application onto the ADP1. Is this a known problem ? Are there any known work- arounds ? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: BroadcastReceiver for a Service to catch broadcast Intent ACTION_BOOT_COMPLETED
Hi Marco OK remove from the tag but a tag as ac hild of the tag is needed ? Thanks Graeme On Mar 2, 4:15 pm, Marco Nelissen wrote: > On Mon, Mar 2, 2009 at 5:23 AM,Graeme wrote: > > > HI JBQ > > > Thanks for your update & advice. > > >> You should remove > >> android:permission="android.permission.RECEIVE_BOOT_COMPLETE" from > >> your receiver tag: > > > OK I have a typo but I still need to include (and type it > > correctly !! :) the permission according to > > >http://developer.android.com/reference/android/content/Intent.html#AC... > > > right ? > > No, you should not include > 'android:permission="android.permission.RECEIVE_BOOT_COMPLETED"' in > your receiver, for the reasons JBQ explained. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: BroadcastReceiver for a Service to catch broadcast Intent ACTION_BOOT_COMPLETED
HI JBQ Thanks for your update & advice. > You should remove > android:permission="android.permission.RECEIVE_BOOT_COMPLETE" from > your receiver tag: > OK I have a typo but I still need to include (and type it correctly !! :) the permission according to http://developer.android.com/reference/android/content/Intent.html#ACTION_BOOT_COMPLETED right ? Thanks Graeme On Feb 27, 4:47 pm, Jean-Baptiste Queru wrote: > You should remove > android:permission="android.permission.RECEIVE_BOOT_COMPLETE" from > your receiver tag: > > -you have a typo in it. > > -what that really means is "I want the sender to hold that > permission", which isn't what you meant, and is probably what prevents > your code from working. > > JBQ > > > > On Fri, Feb 27, 2009 at 8:33 AM,Graeme wrote: > > > H'mmm > > > I tried adding the following to my AndroidManifest.xml > > > > > http://schemas.android.com/apk/res/android"; > > package="com.bt.btinnovate.android.photoobserver" > > android:versionCode="1" > > android:versionName="1.0.0"> > > > > android:name="android.permission.RECEIVE_BOOT_COMPLETED"> > > > > > > android:name=".MyReceiver" > > > > android:permission="android.permission.RECEIVE_BOOT_COMPLETE" > > > > > > android:name="android.intent.action.BOOT_COMPLETE"/> > > > android:name="android.intent.category.DEFAULT" /> > > > > > > > SNIP... > > > My BroadcastReceiver class looks like :- > > > package com.bt.btinnovate.android.photoobserver; > > > import java.util.Iterator; > > import java.util.Set; > > > import android.content.BroadcastReceiver; > > import android.content.Context; > > import android.content.Intent; > > import android.util.Log; > > > public class MyReceiver extends BroadcastReceiver { > > private static final String TAG="MyRcvr"; > > > �...@override > > public void onReceive(Context ctxt, Intent intent) { > > Log.d(TAG,"onReceive() ---ENTER---"); > > Log.d(TAG,"Intent ACTION: "+intent.getAction()); > > Log.d(TAG,"Intent CATEGORIES ..."); > > Set catSet=intent.getCategories(); > > Iterator it=catSet.iterator(); > > while (it.hasNext()) { > > Log.d(TAG," "+it.next()); > > } > > Log.d(TAG,"Done."); > > Log.d(TAG,"onReceive() ---EXIT-"); > > } > > > } > > > When I boot my ADP1 (attached via USB cable to my Windows dev host), I > > do not get any indication in ddms that the MyReceiver object is > > actually > > receiving the BOOT_COMPLETE Intent. Is there anything wrong with my > > AndroidManifest.xml entry ? > > > Thanks > >Graeme > > > On Feb 27, 3:47 pm, Jean-Baptiste Queru wrote: > >> You need to do it in your manifest, since at the point where > >> boot_completed is sent none of your app code can possibly have run to > >> register a listener. > > >> Be aware that boot_completed is a point where the system is under > >> heavy load/contention - be sure to keep your onReceive function as > >> short as it can possibly be (specifically, avoid I/O if at all > >> possible). > > >> JBQ > > >> On Fri, Feb 27, 2009 at 7:40 AM,Graeme wrote: > > >> > Hi > > >> > I have written a Service component within an application .apk. > >> > I want the Service to receive the ACTION_BOOT_COMPLETE > >> > Intent which I understand is broadcast when the android system has > >> > finished booting. > > >> > I am unclear as to whether I need to declare the BroadcastReceiver > >> > statically within the AndroidManifest.xml file for the application > >> > package > >> > via a tag or whether I need to create it dynamically and > >> > call Context.registerReceiver() etc. within my Service code. > > >> > Can anyone offer any advice, please? > > >> > Thanks > >> >Graeme > > >> -- > >> Jean-Baptiste M. "JBQ" Queru > >> Android Engineer, Google. > > >> Please don't contact me directly.- Hide quoted text - > > >> - Show quoted text - > > -- > Jean-Baptiste M. "JBQ" Queru > Android Engineer, Google. > > Please don't contact me directly. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: BroadcastReceiver for a Service to catch broadcast Intent ACTION_BOOT_COMPLETED
H'mmm I tried adding the following to my AndroidManifest.xml http://schemas.android.com/apk/res/android"; package="com.bt.btinnovate.android.photoobserver" android:versionCode="1" android:versionName="1.0.0"> SNIP... My BroadcastReceiver class looks like :- package com.bt.btinnovate.android.photoobserver; import java.util.Iterator; import java.util.Set; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class MyReceiver extends BroadcastReceiver { private static final String TAG="MyRcvr"; @Override public void onReceive(Context ctxt, Intent intent) { Log.d(TAG,"onReceive() ---ENTER---"); Log.d(TAG,"Intent ACTION: "+intent.getAction()); Log.d(TAG,"Intent CATEGORIES ..."); Set catSet=intent.getCategories(); Iterator it=catSet.iterator(); while (it.hasNext()) { Log.d(TAG," "+it.next()); } Log.d(TAG,"Done."); Log.d(TAG,"onReceive() ---EXIT-"); } } When I boot my ADP1 (attached via USB cable to my Windows dev host), I do not get any indication in ddms that the MyReceiver object is actually receiving the BOOT_COMPLETE Intent. Is there anything wrong with my AndroidManifest.xml entry ? Thanks Graeme On Feb 27, 3:47 pm, Jean-Baptiste Queru wrote: > You need to do it in your manifest, since at the point where > boot_completed is sent none of your app code can possibly have run to > register a listener. > > Be aware that boot_completed is a point where the system is under > heavy load/contention - be sure to keep your onReceive function as > short as it can possibly be (specifically, avoid I/O if at all > possible). > > JBQ > > > > > > On Fri, Feb 27, 2009 at 7:40 AM, Graeme wrote: > > > Hi > > > I have written a Service component within an application .apk. > > I want the Service to receive the ACTION_BOOT_COMPLETE > > Intent which I understand is broadcast when the android system has > > finished booting. > > > I am unclear as to whether I need to declare the BroadcastReceiver > > statically within the AndroidManifest.xml file for the application > > package > > via a tag or whether I need to create it dynamically and > > call Context.registerReceiver() etc. within my Service code. > > > Can anyone offer any advice, please? > > > Thanks > > Graeme > > -- > Jean-Baptiste M. "JBQ" Queru > Android Engineer, Google. > > Please don't contact me directly.- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] BroadcastReceiver for a Service to catch broadcast Intent ACTION_BOOT_COMPLETED
Hi I have written a Service component within an application .apk. I want the Service to receive the ACTION_BOOT_COMPLETE Intent which I understand is broadcast when the android system has finished booting. I am unclear as to whether I need to declare the BroadcastReceiver statically within the AndroidManifest.xml file for the application package via a tag or whether I need to create it dynamically and call Context.registerReceiver() etc. within my Service code. Can anyone offer any advice, please? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to start a Service running when Android boots up ?
Hi I am developing a Service component which runs periodically, triggered by the Alarm Service. At the moment I have written an Activity which enables a user of the Service component to schedule it to run or cancel the service from running (just adds or removes scheduled Alarms via the Alarm Service). However I would like to have the Service component get scheduled to run at Android boot-up time - I would like this to happen without user inter-action (so not using the Activity I have written). I plan to have a stored boolean value in Preferences which will either enable or disable the service. Does the Android Framework support a way for me to support running some code at system boot or soon after ? Thanks for any pointers. Graeme UK --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Starting an Activity by sending an Intent with Extra Data
Hi I have a newbie question which is puzzling me regarding using Intents to start a new Activity but passing some data with the Intent for the new Activity to use. My app has (say) MainActivity from which I want to launch a second activity, SecondActivity, within the same app, whilst I pass an integer parameter to SecondActivity. In MainActivity I want to use an explicit component with my Intent like this, MainActivity FRAGMENT BEGIN int rowId ; rowId = ; // want to start SecondActivity and pass this value to it. Intent i = new Intent( this, SecondActivity.class ); // Now add rowId as Extra Data i.putExtra("com.foo.bar.android.app.rowid", rowId); // start the Activity startActivity(i); MainActivity FRAGMENT END Now my problem is : how do I receive the Intent when SecondActivity gets started and recover the value of the integer parameter ? Which member function of class SecondActivity extends Activity { } will receive the Intent ? SecondActivity::onCreate() ? Or do I need to register a BroadcastReceiver with SecondActivity whose onReceive() method would pick up the Intent ? What is the recommended way of doing this within the Android Framework ? Thanks for any help Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Exception bitmap size exceeds VM budget
Hi I am trying to iterate through all the photo images (produced by ADP1 camera), held on external SD storage in an ADP1. I want to extract the binary data for each image file, determine image size in bytes and send the image data (possibly after compression) over a network conection. My code is generating an exception when I try to generate a Bitmap based on Photos taken by the ADP1 Camera, stored physically on External SD Card Storage. It looks like the image size is exhausting VM for my application. I attempt to extract a Bitmap via android.provider.MediaStore.Images.Media.getBitmap() static member function. My code is (essentially) // given long id which is the "_id" of an Image held in the // Images ContentProvider import android.provider.MediaStore.Images.Media; import android.content.ContentUris; String TAG="MyClass"; Uri externalContentUri = Media.EXTERNAL_CONTENT_URI ; Uri imageUri = ContentUris.withAppendedId(externalContentUri, id); try { // Get a ContentResolver ContentResolver cr = getContentResolver(); // Get a Bitmap Bitmap bp=Media.getBitmap(cr, imageUri); } catch (Throwable t) { Log.e(TAG, "Exception " + t.getMessage() ); } In the DDMS Log I get an Error Message Exception bitmap size exceeds VM budget. Is there a way to avoisd this ? Can I simultaneously compress and extract the image data (say to a JPEG format) ? thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unable to start service Intent
I am repeatedly seeing the following message in the debug console 02-10 16:07:54.186: WARN/ActivityManager(53): Unable to start service Intent { flags=0x4 comp={com.bt.btinnovate.android.photoobserver/ com.bt.btinnovate.android.photoobserver.PhotoUploadService} (has extras) }: not found when trying use the AlarmService to start a local service com.bt.btinnovate.android.photoobserver/ com.bt.btinnovate.android.photoobserver.PhotoUploadService every 30 sconds. Can anyone suggest how to solve this ? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Compiling G1 firmware from source and then re-flashing G1
Hi Jean-Baptiste Thanks for your reply. I assume the G1 phone is tethered via USB to Linux dev PC whilst being rebooted ? Is there a longer (more detailed) description of this procedure posted anywhere ? Thanks Graeme On Jan 27, 12:50 pm, Jean-Baptiste Queru wrote: > This question would be better suited for the android-platform mailing > list, since it's related to working with the android source tree, not > to working with the official SDK. > > You don't need to build an update.zip. Boot our device into the > bootloader (hold the back key while powering up), and run the fastboot > tool (check specifically the flashall command and the -w option). > > JBQ > > > > On Tue, Jan 27, 2009 at 4:07 AM, Graeme wrote: > > > Hi > > > I want to try re-flashing my G1 dev phone with Android compiled from > > source for HTC Touch target. > > > I have followed instructions from > >http://source.android.com/documentation/building-for-dream > > > and extracted proprietary binaries from my G1 dev phone, compiled > > source etc. > > The build appears to have completed succesfully. > > > Now what do I do with the Android build to create an update.zip file > > which I can > > use to reflash the G1 according to this procedure > > >http://forum.brighthand.com/showthread.php?t=263200 > > > Does anyone know the missing step(s) which create a suitable > > update.zip > > from the Andoid firmware compilation ? > > > Thanks for any pointers. > > Graeme > > -- > Jean-Baptiste M. "JBQ" Queru > Android Engineer, Google. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Compiling G1 firmware from source and then re-flashing G1
Hi I want to try re-flashing my G1 dev phone with Android compiled from source for HTC Touch target. I have followed instructions from http://source.android.com/documentation/building-for-dream and extracted proprietary binaries from my G1 dev phone, compiled source etc. The build appears to have completed succesfully. Now what do I do with the Android build to create an update.zip file which I can use to reflash the G1 according to this procedure http://forum.brighthand.com/showthread.php?t=263200 Does anyone know the missing step(s) which create a suitable update.zip from the Andoid firmware compilation ? Thanks for any pointers. Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: What kind of device should Linux udev set up for G1 linked via USB
Hi Faber Well trying again after this post, i did have some sucess On fedora 10. I am using /etc/udev/rules.d/50-android.rules file : SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",ATTR{idProduct} =="0c01",MODE="0666", SYMLINK+="android_adb",OWNER="graeme",GROUP="graeme" A Guy on IRC #android-dev said I should run adb with root permissions so: adb kill-server; sleep 1; sudo adb start-server; and this seemed to work for me. For the first time adb did actually see my G1 ! HTH Rgds graeme 15:42:03 make sure that the checkmark to allow debugging on device is checked in the settings On Jan 26, 3:47 pm, Faber Fedor wrote: > Because misery loves company...I was never able to get my CentOS box or my > Ubuntu VM to see my Dev phone as anything other than a SCSI storage device > either. :-( What I ended up doing is developing on my CentOS desktop and > then transferring everything over to my Macbook to get my app on my Dev > phone. > > You can try asking in the #android IRC channel on freenode.net. Supposedly > there are many people from Google who hang out there, although that didn't > help me any. > > Let me know if you have any success. > > On Mon, Jan 26, 2009 at 10:07 AM, Graeme wrote: > > > > > > > Hi > > > I am trying to get adb to see my Android G1 Dev Phone when I attach it > > to a Fedora 10 > > x86 Linux PC. I have followed recommendations about adding a 50- > > android.rules file > > in /etc/udev/rules.d directory. I have also enabled the applications > > debug mode under > > the G1's Settings/Applications menu. > > > On the Fedora 10 x86 PC I run > > > tail -f /var/log/messages > > > and watch the output as I attach the G1 via USB. The G1 is set up as a > > SCSI mass storage > > by udev. Is this what should happen ? Can anyone from Google answer > > what kind of device should udev set up so that the command adb > > devices actually sees the G1 ? > > What kind of device does adb expect to talk to over USB ? > > > Thanks > > Graeme > > > PS I have had similar experiences/frustrations trying this out with > > Ubuntu 8.10. > > -- > > Faber Fedor > Cloud Computing New Jerseyhttp://cloudcomputingnj.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] What kind of device should Linux udev set up for G1 linked via USB
Hi I am trying to get adb to see my Android G1 Dev Phone when I attach it to a Fedora 10 x86 Linux PC. I have followed recommendations about adding a 50- android.rules file in /etc/udev/rules.d directory. I have also enabled the applications debug mode under the G1's Settings/Applications menu. On the Fedora 10 x86 PC I run tail -f /var/log/messages and watch the output as I attach the G1 via USB. The G1 is set up as a SCSI mass storage by udev. Is this what should happen ? Can anyone from Google answer what kind of device should udev set up so that the command adb devices actually sees the G1 ? What kind of device does adb expect to talk to over USB ? Thanks Graeme PS I have had similar experiences/frustrations trying this out with Ubuntu 8.10. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ConnectManager supports multiple-homing ?
Hi The android.net.ConnectivityManager has a member function requestRouteToHost(int networkType, int hostAddress) to ensure that a route is maintained to deliver traffic to a specified host via a specified network interface (TYPE_WIFI or TYPE_MOBILE). Now does this mean that Android supports multi-homing, that is being connected to a cellular data network and a WiFi-based network at he same time ? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Revocation of Signed Applications
Hi I was wondering if the Android Application installer supports the revocation of certicates of already installed applications ? Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Can Applications consist of just Services
Hi Since an Activity does not need to provide a User Interface at all, does this mean that an Android application can be a background Service ? I 'm not sure why one would want to do this, but is it possible ? I imagine one Activity (which did not create a User Interface) would be needed as a point-of-entry, this Activity could just essentially launch a Service component. Thanks for any insights Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Re: Looping Through Images and getting Image Data Bytes
: DEBUG/TestHttp(388): imageUri: content://media/external/images/media/21 09-05 12:28:41.593: DEBUG/TestHttp(388): No bytes today :( 09-05 12:28:41.593: DEBUG/TestHttp(388): Picture #20 END- 09-05 12:28:41.593: DEBUG/TestHttp(388): Ready to logout 09-05 12:28:41.593: DEBUG/TestHttp(388): onCreate()---exit Am I doing something wrong here ? Or did I just encounter a Bitmap bug ? Thanks Graeme On Sep 5, 1:39 pm, Graeme <[EMAIL PROTECTED]> wrote: > Hi > > I have 21 photo JPEG images on a (simulated) SD Card. I want to read > out the binary > image bytes from each image in turn via the Image ContentProvider and > process the > data (upload to a server). I have written the method processImages() > for my Activity - > > public void processImages() { > Log.d(TAG,"processImages()---ENTER---"); > int cnt=1; > byte [] imageData = null; > Uri extImagesUri = Images.Media.EXTERNAL_CONTENT_URI; > String [] projection = {Images.ImageColumns._ID} ; > Cursor cur = managedQuery(extImagesUri, projection, null, > null, null); > long rowID=0; > int idIndex =0; > // > cur.moveToFirst() ; > while ( cur.moveToNext() ) { > Log.d(TAG,"Picture #"+cnt+" ---begin---"); > idIndex = cur.getColumnIndexOrThrow(Images.Media._ID); > rowID = cur.getLong( idIndex ); > Uri imageUri = Uri.withAppendedPath(extImagesUri, (new > Long(rowID)).toString() ); > Log.d(TAG, "imageUri is " + imageUri.toString() ); > try { > Bitmap bitmap = Images.Media.getBitmap( > getContentResolver(), > > imageUri ); > if (bitmap == null) { > Log.d(TAG, "Sorry no bitmap today :("); > Log.d(TAG,"Picture #"+cnt+" ---end-"); > cnt++; > continue; > } > ByteArrayOutputStream bytes = new > ByteArrayOutputStream(); > if (bytes == null) { > Log.d(TAG, "Sorry no ByteArrayOutputStream > today :("); > Log.d(TAG,"Picture #"+cnt+" ---end-"); > cnt++; > continue; > } > > bitmap.compress(Bitmap.CompressFormat.JPEG, 90, > bytes); > imageData = bytes.toByteArray() ; > Log.d(TAG,"len of data is " + imageData.length + " > bytes"); > // Release bitmap > bitmap = null ; > // > // Do something with imageData > // ... > > // release imageData > imageData=null; > if (bytes != null) { > bytes.close(); > } > > } catch (FileNotFoundException of) { > Log.e(TAG,of.toString(),of); > } catch (IOException ioe) { > Log.e(TAG, ioe.toString(), ioe); > } > Log.d(TAG,"Picture #"+cnt+" ---end-"); > cnt++; > } > Log.d(TAG,"processImages()---EXIT"); > } > > When I run this code I get data fbytes or the first Image only, all > the later Bitmap objects > are returned as null by --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Looping Through Images and getting Image Data Bytes
Hi I have 21 photo JPEG images on a (simulated) SD Card. I want to read out the binary image bytes from each image in turn via the Image ContentProvider and process the data (upload to a server). I have written the method processImages() for my Activity - public void processImages() { Log.d(TAG,"processImages()---ENTER---"); int cnt=1; byte [] imageData = null; Uri extImagesUri = Images.Media.EXTERNAL_CONTENT_URI; String [] projection = {Images.ImageColumns._ID} ; Cursor cur = managedQuery(extImagesUri, projection, null, null, null); long rowID=0; int idIndex =0; // cur.moveToFirst() ; while ( cur.moveToNext() ) { Log.d(TAG,"Picture #"+cnt+" ---begin---"); idIndex = cur.getColumnIndexOrThrow(Images.Media._ID); rowID = cur.getLong( idIndex ); Uri imageUri = Uri.withAppendedPath(extImagesUri, (new Long(rowID)).toString() ); Log.d(TAG, "imageUri is " + imageUri.toString() ); try { Bitmap bitmap = Images.Media.getBitmap( getContentResolver(), imageUri ); if (bitmap == null) { Log.d(TAG, "Sorry no bitmap today :("); Log.d(TAG,"Picture #"+cnt+" ---end-"); cnt++; continue; } ByteArrayOutputStream bytes = new ByteArrayOutputStream(); if (bytes == null) { Log.d(TAG, "Sorry no ByteArrayOutputStream today :("); Log.d(TAG,"Picture #"+cnt+" ---end-"); cnt++; continue; } bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes); imageData = bytes.toByteArray() ; Log.d(TAG,"len of data is " + imageData.length + " bytes"); // Release bitmap bitmap = null ; // // Do something with imageData // ... // release imageData imageData=null; if (bytes != null) { bytes.close(); } } catch (FileNotFoundException of) { Log.e(TAG,of.toString(),of); } catch (IOException ioe) { Log.e(TAG, ioe.toString(), ioe); } Log.d(TAG,"Picture #"+cnt+" ---end-"); cnt++; } Log.d(TAG,"processImages()---EXIT"); } When I run this code I get data fbytes or the first Image only, all the later Bitmap objects are returned as null by --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to transfer Image bytes from MediaStore.Image ContentProvider to byte [] array
Hi Alexa thanks for your pointers. rgds Graeme On Sep 3, 3:36 pm, alexa <[EMAIL PROTECTED]> wrote: > Bitmap bitmap = Media.getBitmap(getContentResolver(), imageUri); > ByteArrayOutputStream bytes = new ByteArrayOutputStream(); > > bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes); > ByteArrayInputStream stream = new > ByteArrayInputStream(bytes.toByteArray()); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to transfer Image bytes from MediaStore.Image ContentProvider to byte [] array
Hi I am puzzled how best to copy a JPEG image data bytes held by the MediaStore.Images ContentProvider to a byte [] within an Activity. I am not certain about how the java.io Classses fit into my scenario... So a sketch of the code might look something like ... import android.provider.MediaStore.Images; import android.net.Uri; import android.database.Cursor; Uri extImagesUri = Images.Media.EXTERNAL_CONTENT_URI; // Images on SD Card // Obtain a Cursor Cursor cur = managedQuery(extImagesUri, null, null, null, null); int rowIndex = cur.getColumnIndexOrThrow(Images.ImageColumns._ID); Uri imageUri = null; byte [] imageBytes = null; String rowStr = null; InputStream inStream=null; OutputStream outStream = null; // Iterate through cursor rows cur.moveToFirst(); while ( cur.moveToNext() ) { // Get RowID long rowID = cur.getLong( rowIndex ); // Image URI rowStr = (new Long(rowID)).toString(); imageUri = Uri.withAppendedPath(extImagesUri, rowStr) ; // Now open an InputStream or OutputStream or a File ?? inStream = getContentResolver().openInputStream( imageUri ); // OR ?? outStream = getContentResolver().openOutputStream( imageUri ); // OR ?? ParcelFiledescriptor pFD = getContentResolver(). openFileDescriptor(imageUri, "r"); // then open a FileInputStream ?? // transfer (copy) image content bytes to imageBytes array < Please help here !!> // do something with imageBytes ... } Can someone please give me some pointers. I am rather a Java newbie so am notclear about which of the java.io classes to leverage. Thanks Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Where does the emulator look for the SD Card Image File ?
Hi Guillaume, Bertl Thanks for clarifying this, the comment in the Android docs about 'using relative paths' seems to be a bit misleading, I will use absolute paths as you both recommend. rgds Graeme On Sep 1, 9:00 am, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > Hi, Graeme > In run configurations I put this in "additional emulator command line > options" the following line: > -sdcard /home/gperrot/.android/sdcard (this is the path of the sdcard > I created, this is neither a default directory nor a default file). > > On Aug 29, 4:55 pm, Bertl <[EMAIL PROTECTED]> wrote: > > > > > Hi Graeme, > > > you need absolute paths, where your sdcard image lays, i.e. if your > > file sdcard.img is in C:\sdcard\sdcard.img, then you should input C: > > \sdcard\sdcard.img, also, the absolute path where your file is. > > > Emulator path play no role. > > > I hope, that's you needed. > > > Regards- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Where does the emulator look for the SD Card Image File ?
Hi Guillaume Thanks for your response. Can you please give an example of how you set your emulator -sdcard option ? Thanks graeme On Aug 29, 3:18 pm, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > I can't answer you about the current eclispe working directory but I > work with absolute paths in eclipse and my sdcard is loaded correctly. > Images are at sdcard's root and I see them in pictures application. > > On 29 août, 15:32, Graeme <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > I want to have Eclipse launch the emulator and set the -sdcard > > mysdcard.img > > option within a Run Configuration. This is configured by > > Eclipse->Run->Open Run Dialog > > > and then setting -sdcard mysdcard.img within the Additional Emulator > > Command Line > > Options text input box on the Target Tab. > > > Thehttp://code.google.com/android/reference/emulator.html#sdcard > > entry says > > that > > > "To load FAT32 disk image in the emulator, start the emulator with the > > -sdcard flag and specify the name and path of your image (relative to > > the current working directory): > > > emulator -sdcard " > > > My question is : When the emulator is launched via a Run Dialog in > > Eclipse, what > > is the current working directory used by the emulator ? Problem: Where > > do I place > > the sdcard image file and/ what relative path to current working > > directory do I need > > to use in the -sdcard option ? > > > Can anyone clarify this please ? > > > Thanks for any help > > Graeme- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Where does the emulator look for the SD Card Image File ?
Hi I want to have Eclipse launch the emulator and set the -sdcard mysdcard.img option within a Run Configuration. This is configured by Eclipse->Run- >Open Run Dialog and then setting -sdcard mysdcard.img within the Additional Emulator Command Line Options text input box on the Target Tab. The http://code.google.com/android/reference/emulator.html#sdcard entry says that "To load FAT32 disk image in the emulator, start the emulator with the -sdcard flag and specify the name and path of your image (relative to the current working directory): emulator -sdcard " My question is : When the emulator is launched via a Run Dialog in Eclipse, what is the current working directory used by the emulator ? Problem: Where do I place the sdcard image file and/ what relative path to current working directory do I need to use in the -sdcard option ? Can anyone clarify this please ? Thanks for any help Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Extracting Cookies from Http Responses etc.
Hi I'm trying to write a HttpClient 4.x application in which a) I extract Cookies from a HTTP Response (following an initial HTPP POST), b) put the Cookie in the next outgoing request (another HTTP POST method), c) get the Cookie(s) from the resulting Response, d) put the Cookie(s) in the next outgoing Request, etc. until end of my HTTP sequence. How do I do this in Android's version of HttpClient 4.x ? I think I need to use Request Interceptors and Response Interceptors. Does anyone have experience with this ? I am currently trying DefaultHttpClient dhc = new DefaultHttpClient() ; // Response Interceptor to extract Cookies from Responsies and add to CookieStore dhc.addResponseInterceptor( new ResponseProcessCookies() ); // Request Interceptor to add Cookies from CookieStore to outgoing Requests dhc.addRequestInterceptor( new RequestAddCookies() ); // Create a HttpPost HttpPost post1= new HttpPost("some-url-or-other"); // Send first request & get response HttpResponse rsp1 = dhc.execute( post1 ); //Create second HttpPost HttpPost post2 = new HttpPost("some-url-or-other"); //Send the seconfd POST and get a response HttpResponse rsp2 = dhc.execute( post2 ); etc. BTW Am I able to examine the contensts of the CookieStore ? (If so, how ?) Thanks for any pointers Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Socket exception-unknown error from HttpClient execute() method
hi sacoskun Thanks for your suggestion. Yes I had not set the INTERNET permission in my AndroidManifest.xml. I have updated that now and the socket exception has changed to being about being unable to resolve the domain name of a http proxy server I am located behind. I have noticed other threads where http-proxy usage has been problematic. Thanks for your tip. Best Regards Graeme On Aug 22, 7:30 am, sacoskun <[EMAIL PROTECTED]> wrote: > Did you add android:name="android.permission.INTERNET" /> tag to your > AndroidManifest.xml? > The new SDK requires that permission for network calls. > > sacoskun > > On Aug 21, 6:13 pm, Graeme <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone > > > I'm trying to figure out how to use HttpClient 4.x to do POST requests > > routed via > > a Proxy server. I'm seeing a socket exception triggered by calling > > > DefaultHttpClient.execute(HttpHost target, HttpRequest method). My > > HttpPoster class looks like > > > package com.bt.gcto.android.testhttp; > > > import java.io.IOException; > > import java.util.Hashtable; > > > import org.apache.http.Header; > > import org.apache.http.HttpEntity; > > import org.apache.http.HttpHost; > > import org.apache.http.HttpResponse; > > import org.apache.http.HttpVersion; > > import org.apache.http.client.HttpClient; > > import org.apache.http.client.methods.HttpPost; > > import org.apache.http.conn.ClientConnectionManager; > > import org.apache.http.conn.params.ConnRoutePNames; > > import org.apache.http.conn.scheme.PlainSocketFactory; > > import org.apache.http.conn.scheme.Scheme; > > import org.apache.http.conn.scheme.SchemeRegistry; > > import org.apache.http.conn.scheme.SocketFactory; > > import org.apache.http.conn.ssl.SSLSocketFactory; > > import org.apache.http.impl.client.DefaultHttpClient; > > import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; > > import org.apache.http.params.BasicHttpParams; > > import org.apache.http.params.HttpParams; > > import org.apache.http.params.HttpProtocolParams; > > import org.apache.http.util.EntityUtils; > > > import android.net.Uri; > > import android.util.Log; > > > public class HttpPoster { > > private final String TAG="HttpPoster"; > > private final String NETWORK_DEVICE_SIDE_TRUE = > > ";deviceside=true"; > > private final String NETWORK_DEVICE_SIDE_FALSE = > > ";deviceside=false"; > > private final String NETWORK_WIFI = ";interface=wifi"; > > //private final String proxy="proxy.intra.bt.com:8080"; > > private boolean useWifi; > > private boolean deviceSide; > > // Apache HttpClient 4.x stuff > > private static HttpParams defaultParameters = null; > > private static SchemeRegistry supportedSchemes = null; > > > /** > > * Performs general setup. > > * This should be called only once. > > */ > > private final static void setup() { > > > supportedSchemes = new SchemeRegistry(); > > > // Register the "http" and "https" protocol schemes, they > > are > > // required by the default operator to look up socket > > factories. > > SocketFactory sf = PlainSocketFactory.getSocketFactory(); > > supportedSchemes.register(new Scheme("http", sf, 80)); > > sf = SSLSocketFactory.getSocketFactory(); > > supportedSchemes.register(new Scheme("https", sf, 80)); > > > // prepare parameters > > HttpParams params = new BasicHttpParams(); > > HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); > > HttpProtocolParams.setContentCharset(params, "UTF-8"); > > HttpProtocolParams.setUseExpectContinue(params, true); > > defaultParameters = params; > > > } // setup > > > private final static HttpParams getParams() { > > return defaultParameters; > > } > > > HttpPoster(boolean deviceSide, boolean useWifi) { > > this.useWifi = useWifi; > > this.deviceSide = deviceSide; > > System.err.println("HttpPoster::HttpPoster"); > > } > > >
[android-developers] Socket exception-unknown error from HttpClient execute() method
.mycompany.com", 8080, "http"); setup() ; // Some general setup client = new DefaultHttpClient() ; client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); method = new HttpPost( fullUrl ); Log.d(TAG,"Executing request to " + target + " via " + proxy); rsp = client.execute(target, method); entity = rsp.getEntity(); Log.d(TAG,"-----"); Log.d(TAG, rsp.getStatusLine().toString() ); Header [] headers = rsp.getAllHeaders(); for (int i=0; ihttp://my-gallery- server/gallery2/main.php"); private final String uname = "graeme"; private final String pwd = "123456"; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { Log.d(TAG,"onCreate()---enter---"); super.onCreate(icicle); setContentView(R.layout.main); try { HttpPoster poster = new HttpPoster(false, false) ; poster.post( galleryServerUri.toString(), null, null ); } catch (Exception e) { Log.e(TAG, "Error", e); } Log.d(TAG,"onCreate()---exit"); } } The logcat ouput from class HttpPoster is just ... 08-21 14:25:54.257: DEBUG/HttpPoster(238): post() ---ENTER--- 08-21 14:25:54.257: DEBUG/HttpPoster(238): HttpPoster::post 08-21 14:25:54.257: DEBUG/HttpPoster(238): http.proxyHost = null 08-21 14:25:54.257: DEBUG/HttpPoster(238): http.proxyPort = null 08-21 14:25:54.269: DEBUG/HttpPoster(238): HttpPoster::post -- about to open connection on URL = http://my-gallery-server/gallery2/main.php;deviceside=false 08-21 14:25:54.289: DEBUG/HttpPoster(238): Executing request to http://my-gallery-server:80 via http://proxy.mycompany.com:8080 I am running Android SDK-0.9 on and Windows XP SP2 devel machine. Do I need to take any special; steps to enable the emulator to open network (socket) connections ? Thanks for any help. Graeme --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---