[android-developers] Re: XMPP file Transfer
We haven't done that as well, but we are also developing a client and need to do file transfer at some point - so we are interested as well. Earlence - have you managed to run the davanum code/sample on the emulator, because we can't run it on the emulator (works on the actual dev phone though) ? We get some sort of weird pull parser exception. What version of smack/openfire/android sdk are you using? Thanks On Sun, Jan 18, 2009 at 7:09 AM, Tez wrote: > > Hi, > > Has anyone accomplished a file transfer using the XMPP smack port by > davanum? > > Cheers, > Earlence > > > > --~--~-~--~~~---~--~~ 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: Converting Bitmap to Byte Array
http://www.exampledepot.com/egs/java.io/SerializeObj.html ?? On Mon, Jan 12, 2009 at 3:18 PM, Mike Reed wrote: > > Bitmap.compress(...) ? > > On Sat, Jan 10, 2009 at 2:40 AM, Timothy DeWees > wrote: > > > > Hello, > > > > I need to re-size a Bitmap and save it to a database. I can perform > > the resize, but how do I convert the re-sized Bitmap back to a Byte > > array for storage in the BLOB? > > > > Original format is JPG/PNG > > > > > > > > > --~--~-~--~~~---~--~~ 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: JSON easy Marshall/Unmarshall
Thanks for the hint Mark - we'll try that as well. Btw we just wanted to let everyone know that we've tried latest trunk code from http://fisheye.codehaus.org/browse/jackson/ (just pick the binary tarball links in the bottom lefthand corner, install and, go to directory, and do 'ant dist' - then pickup jar from dist directory - we used lgpl version. Then use the code we submitted below. But you will need to patch a few classes in the jackson json code becuase they are referencing classes that don't exist in android - for e.g. XMLGregorianCalendar . Whenever you get a no classdef found error using this framework, go to that line in code, comment it out, do ant clean/ant dist again, remove the library from classpath in eclipse, add it again so that eclipse android plugin will package it again inside your android project - rinse, repeast. You will need to do this in two classes I think, and at 3-4 different places - you won't have to comment out a LOT of code - if this works without any issues, we can try talking to the author so that we can have compatibility with android. So far, we can serialise/deserialise very complex objects to JSON successfully) (http://www.cowtowncoder.com/hatchery/jackson/ - now partof codehaus) For hints on how to use, checkout source, our example below, or http://www.cowtowncoder.com/blog/archives/2008/12/entry_121.html (and related entries) public class Customer implements Serializable{ private int x; private int y; public String s = "Hello"; public List ary = new ArrayList(); public List ary2 = new ArrayList(); public Set set = new HashSet(); public Customer(){ set.add(new String("Yarrr!")); ary.add(new String("Savvy?")); } // not the whole class, add getters and setters } public class User implements java.io.Serializable { private Long userid; private String username; private String password; private String firstname; private String middlename; private String lastname; public String s; private Long chatlistid; private Long latitude; private Long longitude; private Set events = new HashSet(0); private Set addresses = new HashSet(0); private Set mails = new HashSet(0); private Set groups = new HashSet(0); private Set requests = new HashSet(0); private Set chatmessages = new HashSet(0); private Set broadcasts = new HashSet(0); private Set albums = new HashSet(0); private Set todos = new HashSet(0); private Set subscriptions = new HashSet(0); private Set avatars = new HashSet(0); private Set notes = new HashSet(0); private Customer c = new Customer(); // not the whole class, add getters and setters/empty constructor } // some arbitrary place in android - e.g. code executed in response to a DoIT button User aTestObj = new User(); ObjectMapper aMapper = new ObjectMapper(); StringWriter aWriter = new StringWriter(); JsonGenerator aGen; try { aGen = new JsonFactory().createJsonGenerator(aWriter); aMapper.writeValue(aGen, aTestObj); aGen.close(); System.out.println(aWriter.toString()); User result = new ObjectMapper().readValue(aWriter.toString(), User.class); System.out.println(result); // doesn't really do anything, just debug this line // to find out if you got back the original object or not - yes I'm lazy } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } On Sat, Jan 10, 2009 at 12:52 PM, Mark Murphy wrote: > > > > Apache Thrift works on Android, at least in terms of their data > marshalling code. > > http://incubator.apache.org/thrift/ > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 2.0 Published! > > > > --~--~-~--~~~---~--~~ 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: Urgent: MapActivity - Couldn't get connection factory client (API key does not work)
Thanks a lot Bryan, I'll get this checked today and get back to you. Cheers On Tue, Nov 4, 2008 at 4:53 PM, bryan <[EMAIL PROTECTED]> wrote: > > Eclipse 3.4.1 > JDK 1.5.0_16 > Android SDK 1-1.0_r1 > Mac OS X 10.5 > > > Used "keytool -list -keystore ~/.android/debug.keystore" to get my > md5. > > > public class MyMapView extends MapActivity { >private static final int MILLION = 100; >MapView map; >MapController controller; >double lat; >double lon; >GeoPoint myPoint; > >@Override >public void onCreate(Bundle savedInstanceState) { >super.onCreate(savedInstanceState); >setContentView(R.layout.gps_mapview); > >Intent i = getIntent(); >lat = i.getDoubleExtra("latitude", 0); >lon = i.getDoubleExtra("longitude", 0); >int latE6 = (int) (lat * MILLION); >int lonE6 = (int) (lon * MILLION); >myPoint = new GeoPoint(latE6, lonE6); > >map = (MapView) findViewById(R.id.mapView); >ViewGroup zoom=(ViewGroup)findViewById(R.id.zoom); >zoom.addView(map.getZoomControls()); >controller = map.getController(); >controller.setZoom(17); >controller.setCenter(myPoint); >} > } > > > > gps_mapview.xml: > http://schemas.android.com/apk/res/ > android" android:layout_height="fill_parent" > android:layout_width="fill_parent" android:id="@+id/RelativeLayout01"> > android:id="@+id/mapView" >android:layout_width="fill_parent" >android:layout_height="fill_parent" >android:apiKey="07c5fr_xEBx7bK9b7bK9e0Wc07bK9CYr7bK9zQ" >android:clickable="true"/> > android:layout_height="wrap_content" android:id="@+id/zoom" > android:layout_alignParentBottom="true" > android:layout_centerInParent="true"> > > > > > On Nov 3, 11:27 am, "Shahbaz Khalid" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Very frustrated about this error since we can reproduce this on a number > of > > machines. > > > > The error is self explanatory, googlemaps don't appear at all. This was > > working perfectly (albeit all the IOException warnings) before the API > key > > requirement. Moving to another coordinate in googlemaps (Sending gps > > latitude/longitude coordinates through DDMS) doesn't work either (this > > worked before). > > > > Is there anyone who can post a working sample (with xmls) that works for > > them? Would also appreciate if they can post their platform/eclipse/jdk > > version details. > > > > Thanks > > > > On Mon, Nov 3, 2008 at 2:48 PM, ams163 <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > > > We've tried this on a number of our development machines, but so far > > > this is not working for us. > > > > > We are consistently getting the following errors in DDMS LogCat : > > > > > 'MapActivity - Couldn't get connection factory client' > > > > > and a LOT of : > > > > > 'WARN/AndroidHttpConnectionFactory(167): IOException in HttpClient: > > > The target server failed to respond' > > > > > warnings. A few days ago this was working for us when there wasn't the > > > googlemaps API key requirement, although we still had these HttpClient > > > warning messages coming up for us. > > > > > We are using Android SDK Debug certificate in eclipse as instructed > > > here: > > > > >http://code.google.com/android/toolbox/apis/mapkey.html > > > > > Eclipse version is : Version: 3.3.2, Build id: M20080221-1800 > > > JDK: jdk1.6.0_06 > > > Latest Android SDK and Eclipse Plugin > > > Platform, Windows XP SP2 > > > > > Would appreciate any help. > > > > > Thanks > > > --~--~-~--~~~---~--~~ 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: Urgent: MapActivity - Couldn't get connection factory client (API key does not work)
Hi, Very frustrated about this error since we can reproduce this on a number of machines. The error is self explanatory, googlemaps don't appear at all. This was working perfectly (albeit all the IOException warnings) before the API key requirement. Moving to another coordinate in googlemaps (Sending gps latitude/longitude coordinates through DDMS) doesn't work either (this worked before). Is there anyone who can post a working sample (with xmls) that works for them? Would also appreciate if they can post their platform/eclipse/jdk version details. Thanks On Mon, Nov 3, 2008 at 2:48 PM, ams163 <[EMAIL PROTECTED]> wrote: > > Hello, > > We've tried this on a number of our development machines, but so far > this is not working for us. > > We are consistently getting the following errors in DDMS LogCat : > > 'MapActivity - Couldn't get connection factory client' > > and a LOT of : > > 'WARN/AndroidHttpConnectionFactory(167): IOException in HttpClient: > The target server failed to respond' > > warnings. A few days ago this was working for us when there wasn't the > googlemaps API key requirement, although we still had these HttpClient > warning messages coming up for us. > > We are using Android SDK Debug certificate in eclipse as instructed > here: > > http://code.google.com/android/toolbox/apis/mapkey.html > > Eclipse version is : Version: 3.3.2, Build id: M20080221-1800 > JDK: jdk1.6.0_06 > Latest Android SDK and Eclipse Plugin > Platform, Windows XP SP2 > > Would appreciate any help. > > Thanks > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---