[android-developers] Re: what is the meaning of 'cross compiling'

2009-01-10 Thread hmmm

like, you compile in the windows environment to produce a program which runs 
on arm
http://en.wikipedia.org/wiki/Cross-compiling
Nothing much to think about

- Original Message - 
From: lucius lucius.fo...@gmail.com
To: Android Developers android-developers@googlegroups.com
Sent: Saturday, January 10, 2009 10:24 AM
Subject: [android-developers] what is the meaning of 'cross compiling'



 Hi,

 When I read the postings in this newsgroup, i see a lot of time people
 say 'cross compiling'
 What does it mean? Can someone please help me?

 Thank you.
  


--~--~-~--~~~---~--~~
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: DRAG AND DROP

2009-01-10 Thread kaushik sur
hi Peli

thank you very much for giving me the correct direction.

regards
Kaushik

On Fri, Jan 9, 2009 at 7:58 PM, Peli peli0...@googlemail.com wrote:


 Introduce new member variables of your class:
 int mOffsetX;
 int mOffsetY;


 Then below you do something like:

 if ( action == MotionEvent.ACTION_DOWN ) {
 System.out.println(X=+mCurX+  y=+mCurY);
this.setText(x:  + mCurX + ,y:  + mCurY );

 mOffsetX = mCurX - 10; // 10 was the initial coordinate
mOffsetY = mCurY - 10;

   } else if ( action == MotionEvent.ACTION_MOVE ) {
 System.out.println(X=+mCurX+  y=+mCurY);
this.setText(x:  + mCurX + ,y:  + mCurY );
AbsoluteLayout.LayoutParams p = new
AbsoluteLayout.LayoutParams
 (AbsoluteLayout.LayoutParams.WRAP_CONTENT,
  AbsoluteLayout.LayoutParams.WRAP_CONTENT,this.getScrollX()+
 mCurX + mOffsetX,
  this.getScrollY()+mCurY + mOffsetY);  Here you add the
 offset values.
this.setLayoutParams (p);

   }

 I hope this helps as a pointer. Note that after you placed the object
 to a new position, you have to remember the new coordinates (instead
 of (10,10) where you started originally).

 ACTION_DOWN is called when you click the mouse button, ACTION_MOVE is
 called while you click and drag, and ACTION_UP is called when you
 release the mouse button. Replace mouse by finger on the actual
 device :-)

 I hope this is what you meant.

 Peli
 www.openintents.org


 On Jan 9, 2:46 pm, kaushik sur kaushik@gmail.com wrote:
  hi
 
  Can you please illustrate the scenarios of the constants
  ACTION_MOVE,ACTION_DOWN,ACTION_UP ?
 
  regards
  Kaushik
 
  On Fri, Jan 9, 2009 at 6:22 PM, Peli peli0...@googlemail.com wrote:
 
   what you have to do is, remember the coordinates that you get with the
   ACTION_DOWN event.
 
   Remember the distance (difference) between those coordinates and the
   original coordinates of your image (call that offsetX and offsetY),
   and subsequently in ACTION_MOVE always add those offset values.
 
   Peli
 
   On Jan 9, 11:36 am, kaushik sur kaushik@gmail.com wrote:
Hi Peli
 
here i attach my code, to be added , i have ressolved the issue of
 double
image by getting rawX() value of the event , and setting my absolute
   layout
according to that.
but here i get a unique problem, whenever i click the button and try
 to
   drag
it, the mouse tip comes to a certain pixels above from the topleft
 corner
   of
the button,like a offset distance,if you run the code on the emulator
 u
   wil
find this problem.
can anyone help to solve this?
 
package com.google.android.samples.view.draganddrop;
 
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Bundle;
import android.view.MotionEvent ;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AbsoluteLayout;
import android.widget.Button;
import android.widget.Toast;
 
public class Drag_And_Drop extends Activity {
 /** Called when the activity is first created. */
 
 @Override
 public void onCreate(Bundle icicle) {
  super.onCreate(icicle);
 
  MyView tx = new MyView(this);
  tx.setText(Drag Me);
  AbsoluteLayout l = new AbsoluteLayout(this);
 
  AbsoluteLayout.LayoutParams p = new AbsoluteLayout.LayoutParams(
AbsoluteLayout.LayoutParams.WRAP_CONTENT,
AbsoluteLayout.LayoutParams.WRAP_CONTENT,10,10);
  l.addView(tx,p);
  setContentView(l);
 
 }
 
 class MyView extends Button
 {
  public MyView(Context c){
   super(c);
 
  }
 
  @Override
  public boolean dispatchTouchEvent(MotionEvent event) {
   intmCurX=(int)event.getRawX();
   int mCurY=(int)event.getRawY();;
   System.out.println(scrollx +this.getScrollX());
   int action = event.getAction();
   if ( action == MotionEvent.ACTION_MOVE ) {
System.out.println(X=+mCurX+  y=+mCurY);
this.setText(x:  + mCurX + ,y:  + mCurY );
AbsoluteLayout.LayoutParams p = new
   
 AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT,
  AbsoluteLayout.LayoutParams.WRAP_CONTENT,this.getScrollX()+
 mCurX,
  this.getScrollY()+mCurY);
this.setLayoutParams (p);
 
   }
   return true;
  }
 
  @Override
  public void draw(Canvas canvas) {
   // TODO Auto-generated method stub
   super.draw(canvas);
 
  }
 
 }
 
}
 
#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/hello
*
 
/
 
Button
 
android:id=*@+id/button
  

[android-developers] Re: my rotated bitmaps unrotate immediately after invoking setCenter() method

2009-01-10 Thread DMT

Problem solved.

Had nothing to do the 'setCenter()' fn. Problem was with the way I was
computing my angle/orientation updates: when the map is recentered,
the user's cartesian coords are also automatically shifted, so must
use geodesic info instead.


On Dec 21 2008, 8:46 pm, DMT droiddevelo...@gmail.com wrote:
 It seems that invoking the .setCenter(mygeopoint) method on a
 MapController object has the side effect of setting the orientation of
 any rotated bitmaps back to the original orientation. Has anyone else
 also experienced this?

 My problem is that I'm writing a map application that needs to rotate
 an arrow bitmap to point in the direction of the cellphone's motion,
 and I want to periodically automatically re-center the map so that the
 user's position does not drift off the map.
 However, each time I call 'setCenter(mygeopoint)', my arrow bitmap
 unrotates back to its original heading, therefore the user loses the
 directional information.

 Anyone found a workaround for this problem?

 Thanks in advance.
--~--~-~--~~~---~--~~
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: Text animation question

2009-01-10 Thread Meth

Hello,

It is not enough to use a single TextView for the effect you need. You
should rather use TextSwitcher class.
Take a look at SDK samples. There is
com.example.android.apis.view.TextSwitcher1 class there. It is good
demonstration of using TextSwitcher class.

Hope this helps.

On Jan 10, 8:07 am, g1bb corymgibb...@gmail.com wrote:
 Hello,

 I'm working on sometextanimationwith 2 left and right buttons,
 iterating through an array, and scrolling thetextoff of the screen
 (so left button scrolls thetextoff the screen to the left, and vice-
 versa).

 The problem I'm finding, is that I want to keep the currenttextuntil
 theanimationhas been completed, and _then_ change thetext(next
 item in the array), but thetextseems to change first, and then
 scroll.

 Here's my XML foranimation(R.anim.anim_left):
 ?xml version=1.0 encoding=utf-8?
 set xmlns:android=http://schemas.android.com/apk/res/android;
 android:shareInterpolator=true android:interpolator=@android:anim/
 accelerate_interpolator

     translate android:fromXDelta=0
                android:toXDelta=250
                android:duration=400
                android:fillAfter=false/
 /set

 And the code for the button:
 if (v == btnLeft) {
 TextView animWindow = (TextView)findViewById(R.id.txtScroll);Animationanim = 
 AnimationUtils.loadAnimation(Main.this,
 R.anim.anim_down);
 animWindow.startAnimation(anim);

 final ArrayAdapterString namesArray = new ArrayAdapterString
 (Main.this, R.array.myArray, getResources().getStringArray
 (R.array.myArray));
 setListAdapter(Names);
 Names -= 1;
 txtNames.setText(namesArray.getItem(Names));
  }

 Has anyone else experienced something similar to this, or have any
 ideas?

 Thanks much in advance!
--~--~-~--~~~---~--~~
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: Suggestions for Image Libraries to use on Android.

2009-01-10 Thread ams163

Maybe:

http://code.google.com/p/jjil/

http://code.google.com/p/jjil/wiki/SequencesAndLadders

On Jan 9, 5:37 am, Ryan Moulton ryanmoul...@gmail.com wrote:
 I'm looking to develop an application for which I need to do
 convolutions and the like on an image. I haven't done image processing

--~--~-~--~~~---~--~~
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: any other method

2009-01-10 Thread Faber Fedor
http://commonsware.com/Android/index.html

(Not affiliated, just a happy buyer.)

On Fri, Jan 9, 2009 at 11:56 PM, msmsmukesh msmsmuk...@gmail.com wrote:

 Hi all,Any method to quick to learn the android.




-- 

Faber Fedor
Cloud Computing New Jersey
http://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] Dev Phone: Copying restricted files form device to PC

2009-01-10 Thread František Fuka

I have Android Dev Phone 1 and I want to be able to programatically
copy files form it do my PC (through USB). However, I cannot use adb
pull because some of the files I want to copy are owned by different
users that system. I can copy these files by starting shell on the
device, then doing su, then copying the files to sdcard and then
copying then from sdcard to my PC. Can I do this automatically,
without doing su manually?

Also, it seems Dev Phone doesn't know the cp command to copy files.
I have to use cat from_file  to_file. Surely there is a simpler
solution...?
--~--~-~--~~~---~--~~
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: any other method

2009-01-10 Thread Mark Murphy

Faber Fedor wrote:
 http://commonsware.com/Android/index.html
 
 (Not affiliated, just a happy buyer.)

Thanks for the shout-out!

-- 
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: JSON easy Marshall/Unmarshall

2009-01-10 Thread Mark Murphy

ams163 wrote:
 Hello,
 
 We are working on an client / server application - and the design
 goals for the communications framework are:
 
 1. Low bandwidth
 2. Low Latency
 3. Scalable
 4. Fast marshall/unmarshall
 
 What sort of communications framework do you recommend?
 
 We think json would do the trick, and we can use plain NIO socket
 based communications for the least bandwidth - on the server side, we
 can use something like Apache MINA or Netty.
 
 Serialisation does not work properly on android - other system.
 
 SOAP is just too heavy for communications, not to mention slow due to
 the xml processing involved.
 
 We've thought of using XStream as well, but we need a custom version
 hacked by a forum member here (it works though).
 
 So like I said, JSON is pure string based communications, and can also
 be compressed for transfer.
 
 The only issue we have is that something Google gson, which would have
 been brilliant if it could be used on android to marshall/unmarshall
 complex objects, doesn't work on android. Sure, we can use gson to
 marshall/unmarshall on the server side, but we can't even begin to
 think how we'd do that on android using the minimalistic builtin json
 library for complex classes? Is there something available (Aside from
 gson) that works on android, and that automatically marshalls/
 unmarshalls json?  Let's say we have the following class:
 
 
 class Foo {
public int id;
public ArrayListBar bars  =  new ArrayListBar ();
 }
 
 class Bar {
public int x;
public String name;
public SetString references = new HashSetString(0);
public ArrayListObject list = new ArrayListObject ();
 }
 
 
 The only other thing I can think of is plain socket/byte based
 communications, and building the data structures painfully on the
 client/server - just like in C.

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] Connecting a Google Dev phone to UK Vodafone

2009-01-10 Thread Simon Brooke

Just in case anyone else is struggling with this, there is a solution,
and it's easy.

When you get your new Dev phone, and you stick a Vodafone SIM in it,
it fails to connect to Google's servers and can't initialise. It seems
to be bricked. But wait, all is not lost.

Buy a T-Mobile pay-as-you-go SIM for £5. Put it in your Dev phone and
get in your car. Drive to the within range of your nearest T-Mobile
tower ('not so much a network, more a sparse matrix'). Switch on your
phone, and register with Google.

Ah, you say, but I don't want a T-Mobile phone, they have virtually no
coverage outside city centres.  Verily, I say unto you, be not afraid,
for I bring tidings of great joy. You may now switch off your Dev
phone, extract the T-Mobile SIM card, put in your Vodafone SIM card,
and switch back on. And Lo! all is well and it works.

I've only tried this fix with UK Vodafone, because that's the network
I wanted to use. But if you have trouble getting your Dev phone past
the 'cannot connect to Google servers' phase with your own wireless
provider of choice, this may work for you too.
--~--~-~--~~~---~--~~
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] Traceview only shows old data

2009-01-10 Thread Al

I ran a trace on my app using the Debug class, but it seems the new
trace data isn't loaded by Traceview and somehow only the old data is
shown. I've recreated the sdcard, wiped the emulator and created a new
launch config (in Eclipse). I also changed my package name but
traceview still shows the old data with the old package name. Logcat
shows it writes the data fine to /sdcard but for some reason, the new
info isn't shown.

Any ideas what would cause this?

--~--~-~--~~~---~--~~
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

2009-01-10 Thread Fred Grott(shareme)

Thanks Mark..

Is that  the only one that works right now?

On Jan 10, 6:52 am, Mark Murphy mmur...@commonsware.com wrote:
 ams163 wrote:
  Hello,

  We are working on an client / server application - and the design
  goals for the communications framework are:

  1. Low bandwidth
  2. Low Latency
  3. Scalable
  4. Fast marshall/unmarshall

  What sort of communications framework do you recommend?

  We think json would do the trick, and we can use plain NIO socket
  based communications for the least bandwidth - on the server side, we
  can use something like Apache MINA or Netty.

  Serialisation does not work properly on android - other system.

  SOAP is just too heavy for communications, not to mention slow due to
  the xml processing involved.

  We've thought of using XStream as well, but we need a custom version
  hacked by a forum member here (it works though).

  So like I said, JSON is pure string based communications, and can also
  be compressed for transfer.

  The only issue we have is that something Google gson, which would have
  been brilliant if it could be used on android to marshall/unmarshall
  complex objects, doesn't work on android. Sure, we can use gson to
  marshall/unmarshall on the server side, but we can't even begin to
  think how we'd do that on android using the minimalistic builtin json
  library for complex classes? Is there something available (Aside from
  gson) that works on android, and that automatically marshalls/
  unmarshalls json?  Let's say we have the following class:

  class Foo {
     public int id;
     public ArrayListBar bars  =  new ArrayListBar ();
  }

  class Bar {
     public int x;
     public String name;
     public SetString references = new HashSetString(0);
     public ArrayListObject list = new ArrayListObject ();
  }

  The only other thing I can think of is plain socket/byte based
  communications, and building the data structures painfully on the
  client/server - just like in C.

 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: JSON easy Marshall/Unmarshall

2009-01-10 Thread Mark Murphy

Fred Grott(shareme) wrote:
 Is that  the only one that works right now?

The only one...what?

The OP's list had many other alternatives. I agree with his assessment:

-- JSON is nice but you either need to do your own marshalling code or
use something like Thrift (which, unfortunately, can only export JSON --
bi-directional is a tight binary format)

-- Java serialization is evil evil evil for interop

-- SOAP is heavy

-- Other stuff like XStream might require porting work

I just happen to know that Thrift's Java implementation compiles and
runs cleanly on Android, at least circa ~2 months ago.

I don't know if JSON+compression is faster and/or smaller on-wire than
Thrift's binary packaging.

If by the only one that works you mean whether the Thrift service
endpoint logic works, it might -- I just haven't tried it. My one case
was using Thrift binary packaging over HTTP.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

--~--~-~--~~~---~--~~
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: Connecting a Google Dev phone to UK Vodafone

2009-01-10 Thread blindfold

I'm with Vodafone in The Netherlands, and I did not need to buy a
different SIM card to get my dev phone 1 registered with Google. I
remember that I did have to add live.vodafone.com (and perhaps
web.vodafone.nl when doing things via Wifi, not sure) to the list of
access point names, and of course select Vodafone NL as my operator
network. Don't know if Vodafone works differently in the UK.

On Jan 10, 3:30 pm, Simon Brooke still...@googlemail.com wrote:
 Just in case anyone else is struggling with this, there is a solution,
 and it's easy.

 When you get your new Dev phone, and you stick a Vodafone SIM in it,
 it fails to connect to Google's servers and can't initialise. It seems
 to be bricked. But wait, all is not lost.

 Buy a T-Mobile pay-as-you-go SIM for £5. Put it in your Dev phone and
 get in your car. Drive to the within range of your nearest T-Mobile
 tower ('not so much a network, more a sparse matrix'). Switch on your
 phone, and register with Google.

 Ah, you say, but I don't want a T-Mobile phone, they have virtually no
 coverage outside city centres.  Verily, I say unto you, be not afraid,
 for I bring tidings of great joy. You may now switch off your Dev
 phone, extract the T-Mobile SIM card, put in your Vodafone SIM card,
 and switch back on. And Lo! all is well and it works.

 I've only tried this fix with UK Vodafone, because that's the network
 I wanted to use. But if you have trouble getting your Dev phone past
 the 'cannot connect to Google servers' phase with your own wireless
 provider of choice, this may work for you too.
--~--~-~--~~~---~--~~
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] Parsing Special Characters with SAX Parser

2009-01-10 Thread mobilek...@googlemail.com

Hi,

I'm having hard time parsing special characters such as '' with the
default handler provided in org.xml.sax.helpers.

Basically, the parser reads up to where it encounters '' and skips
the rest.

I tried escaping the with amp; and #038; but none worked. Any ideas?

Thank you!
--~--~-~--~~~---~--~~
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: Connecting a Google Dev phone to UK Vodafone

2009-01-10 Thread Al Sutton

You can get free PAYG sim cards from T-Mobile UK from;

http://www.t-mobile.co.uk/shop/free-pay-as-you-go-sim-cards/

blindfold wrote:
 I'm with Vodafone in The Netherlands, and I did not need to buy a
 different SIM card to get my dev phone 1 registered with Google. I
 remember that I did have to add live.vodafone.com (and perhaps
 web.vodafone.nl when doing things via Wifi, not sure) to the list of
 access point names, and of course select Vodafone NL as my operator
 network. Don't know if Vodafone works differently in the UK.

 On Jan 10, 3:30 pm, Simon Brooke still...@googlemail.com wrote:
   
 Just in case anyone else is struggling with this, there is a solution,
 and it's easy.

 When you get your new Dev phone, and you stick a Vodafone SIM in it,
 it fails to connect to Google's servers and can't initialise. It seems
 to be bricked. But wait, all is not lost.

 Buy a T-Mobile pay-as-you-go SIM for £5. Put it in your Dev phone and
 get in your car. Drive to the within range of your nearest T-Mobile
 tower ('not so much a network, more a sparse matrix'). Switch on your
 phone, and register with Google.

 Ah, you say, but I don't want a T-Mobile phone, they have virtually no
 coverage outside city centres.  Verily, I say unto you, be not afraid,
 for I bring tidings of great joy. You may now switch off your Dev
 phone, extract the T-Mobile SIM card, put in your Vodafone SIM card,
 and switch back on. And Lo! all is well and it works.

 I've only tried this fix with UK Vodafone, because that's the network
 I wanted to use. But if you have trouble getting your Dev phone past
 the 'cannot connect to Google servers' phase with your own wireless
 provider of choice, this may work for you too.
 
 
   


-- 
==
Funky Android Limited is registered in England  Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~-~--~~~---~--~~
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: Parsing Special Characters with SAX Parser

2009-01-10 Thread Mark Murphy

mobilek...@googlemail.com wrote:
 Hi,
 
 I'm having hard time parsing special characters such as '' with the
 default handler provided in org.xml.sax.helpers.
 
 Basically, the parser reads up to where it encounters '' and skips
 the rest.
 
 I tried escaping the with amp; and #038; but none worked. Any ideas?

I just ran into a similar case with the DOM. In my case, I had an
element akin to:

nameFoo amp; Bar/name

The DOM had three text nodes inside the Element:

-- One with Foo 
-- One with 
-- One with amp; Bar

I had expected perhaps two text nodes and an EntityReference or
something, but my DOM-fu is weak, so perhaps this is the proper result.

If this same pattern affects SAX, it may be you are getting several text
nodes but are only paying attention to the first.

-- 
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] my app sometimes take 1 second to load, sometimes 50 seconds

2009-01-10 Thread bwilliam...@gmail.com

Hi all,

I'm pretty stumped here.

I've got an app that more or less follows the layout of LunarLander,
with an Activity, a View, and a Thread. The View extends SurfaceView
and the thread is what does the drawing. It is relatively light on
resources - 16 PNGs totalling 240KB, one simple layout xml, and one
simple values xml.

The load time for the app is all over the map. It sometimes loads in
under a second, sometimes it takes as much as 50 seconds. But as long
as I don't touch it, it *always* finishes loading eventually (if I try
to interact with it, I get the isn't responding window and have the
option to kill it.. though even then it will finish loading if I wait
long enough). The behavior is the same whether I'm running my code on
the emulator or an actual ADP1.

I've done a fair amount of logging to try to figure out what's going
on, but I'm not getting anywhere. My activity's onStart() is always
done in less than 2 seconds; my view and thread are also ready to go
within 2 seconds. Even my first call to onDraw() is always done in
under 3 seconds from the time the activity starts.

After all that is done, I'll be starting at a blank screen (with my
title bar) for a very arbitrary amount of time. Finally, the logcat
will show me:

I/ActivityManager( 52): Displayed activity
com.android.slots/.SlotsAndroid: 11301 ms
Of course, 11301 ms is sometimes 800ms, 3000ms, 2ms, or 5ms
instead. Unfortunately, until that line shows up, my app is
unresponsive and does not actually fill in the black space on the
screen.

I can't figure out what is going on in the time between when my app
seems to be saying it's completely ready and when android decides it's
ready to go. Has anyone else seen this? Does anyone else have any
ideas?
--~--~-~--~~~---~--~~
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: Text animation question

2009-01-10 Thread g1bb

That worked great, and much more smoothly than an animation. Thanks!

On Jan 10, 2:53 am, Meth rniedzi...@gmail.com wrote:
 Hello,

 It is not enough to use a single TextView for the effect you need. You
 should rather use TextSwitcher class.
 Take a look at SDK samples. There is
 com.example.android.apis.view.TextSwitcher1 class there. It is good
 demonstration of using TextSwitcher class.

 Hope this helps.

 On Jan 10, 8:07 am, g1bb corymgibb...@gmail.com wrote:

  Hello,

  I'm working on sometextanimationwith 2 left and right buttons,
  iterating through an array, and scrolling thetextoff of the screen
  (so left button scrolls thetextoff the screen to the left, and vice-
  versa).

  The problem I'm finding, is that I want to keep the currenttextuntil
  theanimationhas been completed, and _then_ change thetext(next
  item in the array), but thetextseems to change first, and then
  scroll.

  Here's my XML foranimation(R.anim.anim_left):
  ?xml version=1.0 encoding=utf-8?
  set xmlns:android=http://schemas.android.com/apk/res/android;
  android:shareInterpolator=true android:interpolator=@android:anim/
  accelerate_interpolator

      translate android:fromXDelta=0
                 android:toXDelta=250
                 android:duration=400
                 android:fillAfter=false/
  /set

  And the code for the button:
  if (v == btnLeft) {
  TextView animWindow = (TextView)findViewById(R.id.txtScroll);Animationanim 
  = AnimationUtils.loadAnimation(Main.this,
  R.anim.anim_down);
  animWindow.startAnimation(anim);

  final ArrayAdapterString namesArray = new ArrayAdapterString
  (Main.this, R.array.myArray, getResources().getStringArray
  (R.array.myArray));
  setListAdapter(Names);
  Names -= 1;
  txtNames.setText(namesArray.getItem(Names));
   }

  Has anyone else experienced something similar to this, or have any
  ideas?

  Thanks much in advance!
--~--~-~--~~~---~--~~
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: my app sometimes take 1 second to load, sometimes 50 seconds

2009-01-10 Thread bwilliam...@gmail.com

Very strange.
Someone pointed out to me that I really shouldn't be using com.android
as a package, since it's not my domain.  I just hadn't changed it from
when I was mirroring LunarLander.  And since I changed it, my apps has
yet to take longer than 3 seconds to load.

On Jan 10, 12:20 pm, bwilliam...@gmail.com bwilliam...@gmail.com
wrote:
 Hi all,

 I'm pretty stumped here.

 I've got an app that more or less follows the layout of LunarLander,
 with an Activity, a View, and a Thread. The View extends SurfaceView
 and the thread is what does the drawing. It is relatively light on
 resources - 16 PNGs totalling 240KB, one simple layout xml, and one
 simple values xml.

 The load time for the app is all over the map. It sometimes loads in
 under a second, sometimes it takes as much as 50 seconds. But as long
 as I don't touch it, it *always* finishes loading eventually (if I try
 to interact with it, I get the isn't responding window and have the
 option to kill it.. though even then it will finish loading if I wait
 long enough). The behavior is the same whether I'm running my code on
 the emulator or an actual ADP1.

 I've done a fair amount of logging to try to figure out what's going
 on, but I'm not getting anywhere. My activity's onStart() is always
 done in less than 2 seconds; my view and thread are also ready to go
 within 2 seconds. Even my first call to onDraw() is always done in
 under 3 seconds from the time the activity starts.

 After all that is done, I'll be starting at a blank screen (with my
 title bar) for a very arbitrary amount of time. Finally, the logcat
 will show me:

 I/ActivityManager( 52): Displayed activity
 com.android.slots/.SlotsAndroid: 11301 ms
 Of course, 11301 ms is sometimes 800ms, 3000ms, 2ms, or 5ms
 instead. Unfortunately, until that line shows up, my app is
 unresponsive and does not actually fill in the black space on the
 screen.

 I can't figure out what is going on in the time between when my app
 seems to be saying it's completely ready and when android decides it's
 ready to go. Has anyone else seen this? Does anyone else have any
 ideas?
--~--~-~--~~~---~--~~
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] Eclipse plugin URL invalid?

2009-01-10 Thread Mark Wyszomierski

Hi,

Just switched to eclipse-ganymede, was trying to get the android
plugin via the getting started directions here:

https://dl-ssl.google.com/android/eclipse/

but keep getting an error about that URL being invalid. Is anyone else
having the same problem, the URL used to work when I was developing a
few months ago,

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
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

2009-01-10 Thread Shahbaz Khalid
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 ListString ary = new ArrayListString();
public ListString ary2 = new ArrayListString();
public SetString set = new HashSetString();

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 SetObject events = new HashSetObject(0);
private SetObject addresses = new HashSetObject(0);
private SetObject mails = new HashSetObject(0);
private SetObject groups = new HashSetObject(0);
private SetObject requests = new HashSetObject(0);
private SetObject chatmessages = new HashSetObject(0);
private SetObject broadcasts = new HashSetObject(0);
private SetObject albums = new HashSetObject(0);
private SetObject todos = new HashSetObject(0);
private SetObject subscriptions = new HashSetObject(0);
private SetObject avatars = new HashSetObject(0);
private SetObject notes = new HashSetObject(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 mmur...@commonsware.comwrote:




 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: Eclipse plugin URL invalid?

2009-01-10 Thread Quartz

Remove the s and use http://dl-ssl.google.com/android/eclipse/
instead.

On Jan 10, 1:48 pm, Mark Wyszomierski mar...@gmail.com wrote:
 Hi,

 Just switched to eclipse-ganymede, was trying to get the android
 plugin via the getting started directions here:

    https://dl-ssl.google.com/android/eclipse/

 but keep getting an error about that URL being invalid. Is anyone else
 having the same problem, the URL used to work when I was developing a
 few months ago,

 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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] WebView: Need help with local file Urls in the browser

2009-01-10 Thread Mariano Kamp
Hi,

   let's say I write content onto the local filesystem using  
Context.openFileOutput(). For the sake of this example one file IS  
index.html and one IS image.png. The former references the latter in  
the html code.

   How can I get the browser to display the content? I tried many  
different ways and failed so far.

   I can't just use the url: file:///data/data/com.myapp/files/index.html 
. The browser just says Web page not available. Also when loading  
the content of the index.html file directly, it does not show the  
image. Like this:
contentWebView.loadDataWithBaseURL(file:///data/data/com.myapp/files/index.html
 
, htmlHello, World!img src=\image.png\//html, text/html,  
utf-8, null);

   I wrote the content with Context.MODE_WORLD_READABLE.

   Any ideas? I read somewhere that I should provide a WebClient and  
override shouldOverrideUrlLoading for whatever reason. But that  
doesn't work at all for me. This method is never called (android-sdk- 
mac_x86-1.0_r2).

   I guess I can try to ask the user to turn off shared access for the  
sdcard and use that, but that's really not what I want. In a pinch  
though ... any ideas?

   Also when using Context.openFileInput/Output I can't use folders,  
right? Any ideas if the file system slows down when I have a thousand  
small files there?

Cheers,
Mariano
--~--~-~--~~~---~--~~
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: Eclipse plugin URL invalid?

2009-01-10 Thread blindfold

Get it from here: http://code.google.com/android/adt_download.html

On Jan 10, 7:48 pm, Mark Wyszomierski mar...@gmail.com wrote:
 Hi,

 Just switched to eclipse-ganymede, was trying to get the android
 plugin via the getting started directions here:

    https://dl-ssl.google.com/android/eclipse/

 but keep getting an error about that URL being invalid. Is anyone else
 having the same problem, the URL used to work when I was developing a
 few months ago,

 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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Need help working with xml layout

2009-01-10 Thread Brad A

I have a List and am providing a specific view for each row.  All java
functionality is workign fine, it's the layout of the view elements
that is giving me trouble.  I
This is the layout I'm trying to achieve (how to show in text
message?):
Image - Text(name)/Text(Price) - Button - CheckBox

where Image is on the left, next the 2 text fields are stacked on each
other and centered, then the Button and Checkbox are right-justified.

Here is the xml I have right now ...

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=horizontal
ImageView android:id=@+id/offerImage android:layout_width=80sp
android:layout_height=80sp android:layout_margin=5sp /
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=wrap_content
android:layout_height=fill_parent
android:orientation=vertical
android:layout_gravity=center_vertical
TextView android:id=@+id/productName 
android:layout_width=100sp
android:layout_height=wrap_content
android:textSize=14sp 
android:textColor=@color/screen_black
android:layout_gravity=center_vertical/
TextView android:id=@+id/price
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=center_vertical /
/LinearLayout
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:layout_gravity=right
android:orientation=horizontal

Button android:id=@+id/buy 
android:layout_height=wrap_content
android:layout_width=80sp android:autoText=true
android:text=Preorder
android:layout_gravity=center_vertical|right
/
CheckBox android:id=@+id/favorite 
style=?android:attr/starStyle
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_marginLeft=5sp
android:layout_gravity=center_vertical|right/
/LinearLayout
/LinearLayout

The overall layout seems to be working, looking at the Hierarchy
Viewer, the Linear Layouts I use for the TextViews and the Button/
CheckBox are laid out correctly and occupying the correct space.
however, the TextViews in teh first layout are pinned to the upper-
right corner of the layout, they should be centered.
And the button and checkbox are centered fine, but the are pinned to
the left edge of teh layout and I want then pinned to the right edge
instead.

Does anyone know how i can accomplish this?

Related, when specifying a button, is there a way to just have the
button dynamically size to whatever text is holds?

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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Touch *extremely* expensive performance-wise

2009-01-10 Thread Stoyan Damov

Dianne, I want to thank you again for your advice - it actually
helped. I process at most 10 touch movement events per second (good
enough for the app) and sleep the UI thread after the moves - this did
boost the second thread enough so that most of the app's time is spent
in physics updates and drawing.

Thanks again,
Stoyan

On Sat, Jan 10, 2009 at 3:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote:
 I'll add that the time consumed by my view's onFingerMove is 2/3 of
 the time to call (MotionEvent.getAction + .getX() + .getY()) - that
 is, I'm pretty sure I'm not doing anything funny in my touch event's
 handler.

 On Sat, Jan 10, 2009 at 3:14 AM, Stoyan Damov stoyan.da...@gmail.com wrote:
 On Sat, Jan 10, 2009 at 12:49 AM, Dianne Hackborn hack...@android.com 
 wrote:
 On Fri, Jan 9, 2009 at 1:22 PM, Stoyan Damov stoyan.da...@gmail.com wrote:

 I do yield to the main thread by calling mainActivity.runOnUiThread
 w/ a no-op (cached) runnable once per second but I guess that's not
 enough. I'll try increasing that to see if it will make a difference.
 I'd rather run the game @ 40 fps by losing ~15 fps because of yielding
 than losing ~30 fps because of touch event throttling.

 If I am reading that right, that's not a yield, that is just adding more CPU
 using work on the main thread. :)  What you want to do is force the main
 thread to actually stop running for a bit after processing an event, so that
 it isn't using the CPU and your other thread can run and the window manager
 doesn't immediately turn around and give you another event with more work to
 do.

 Now you got me confused :) but let me 1st explain that by yielding I
 meant that the game thread yielded to the UI one.

 My confusion (now) is that I thought (after your post) that the main
 UI thread was not given enough time to process touch events and the OS
 was doing something (more work) because of that and was leaving my app
 with less time to work. You're now saying it's the opposite, but that
 can't be the problem because before I added the yields, the game
 thread was running at full speed and the UI was so unresponsive (e.g.
 clicking the Menu button resulted in ANR) that I had to do something
 about it and start yielding to the UI thread from the game one
 occasionally.

 However, I realize that you're not really saying to not let the UI
 thread work but to make it unresponsive for a bit every now and then
 (after an event is processed) so that the game thread works more and
 less context switches (made by Android's thread scheduling mechanism,
 not by me marshalling calls) occur. Is that what you're saying?

 Now just before I was about to post this, I profiled the game and let
 me share some *very* interesting facts about the touch handling.

 I ran the game, touched (which triggers the profile start process),
 and immediately removed my finger from the screen and let the
 profiling finish.
 What I saw in Traceview is that 64.7% of the game's time went in
 drawing (which is great!), 33.8% in the game's update, and
 android.os.Handler.dispatchMessage(Message) takes the funny 0.2% - I'm
 mentioning dispatchMessage here because you'll see a DRASTIC change in
 a second.

 I then ran the game, touched the screen and started moving my finger
 without releasing it until the profiling stopped.
 What I saw in Traceview is that 49.1% went in the game's update code,
 only 9% in the draw code and now for the winner -
 Handler.dispatchMessage took 24.7% of the time :O :O :O
 This only makes me think that my assumption that the layers below the
 app are doing something more than expected :(
 I'm yet to find out why would the update vs draw time is 49% to 9%
 (maybe locking the canvas and event handling on the UI thread are
 somewhat related???), but having an overhead of 25% just because I'm
 touching the screen is too much for me.

 Cheers



 I'd rather control the priority myself :)

 How are you going to control the priority yourself?

 Now that you understand what I meant by yielding (that is, not to the
 OS but from the game to the main/UI thread) I guess that question is
 moot.

 Cheers


 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support.  All such questions should be posted on public
 forums, where I and others can see and answer them.


 




--~--~-~--~~~---~--~~
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: Traceview only shows old data

2009-01-10 Thread Stoyan Damov

Is it possible that you're running traceview with a wrong trace file?
I don't use the emulator so it might be an emulator-related thing but
so far the tracing works fine for me w/ the device.

On Sat, Jan 10, 2009 at 5:26 PM, Al alcapw...@googlemail.com wrote:

 I ran a trace on my app using the Debug class, but it seems the new
 trace data isn't loaded by Traceview and somehow only the old data is
 shown. I've recreated the sdcard, wiped the emulator and created a new
 launch config (in Eclipse). I also changed my package name but
 traceview still shows the old data with the old package name. Logcat
 shows it writes the data fine to /sdcard but for some reason, the new
 info isn't shown.

 Any ideas what would cause this?

 


--~--~-~--~~~---~--~~
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] Bundle getting lost after send

2009-01-10 Thread Al

I'm using a Bundle to store some info and then sending it to a
Handler. Problem is the Bundle shows up empty on the other end. I've
logcat-ed the Bundle before sending and after receiving on the other
end, before it's sent, I see the data as expected, but once my
HandleMessage gets called, Bundle.toString shows it as being empty.
Out of about 20 messages, only 1 or 2 show up on the other end.

Any ideas why this would happen?
--~--~-~--~~~---~--~~
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] [android.developers] Low on space

2009-01-10 Thread Stoyan Damov

Hi guys,

I own a G1 and am using it for development.
I have the phone for about a month now and today I got this
notification Low on space with the message Phone storage space is
getting low.

I only have a few programs installed and these take about 4MB.
I've deleted the browser's cache, and can't figure out why the storage
has become so low. I only got 7MB free!!! (btw out of how much?!!? I
can see how much free space I got but out of how much, how can I find
out?)
My guess is that it might be something related to the fact that I
upload my own app pretty often to the device to debug it and it might
have generated some error logs or something. I don't have a clue.

Please, help! :)

Cheers,
Stoyan

P.S. For those who read both the beginners and devs lists, sorry for
the cross post, I'm getting desperate!

--~--~-~--~~~---~--~~
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: Traceview only shows old data

2009-01-10 Thread Al

Heh, I tried cd-ing to the SDK folder and running it directly from
there with an absolute path to the trace file and it worked! Should
have tried that before. All sorted now.

On Jan 10, 9:22 pm, Stoyan Damov stoyan.da...@gmail.com wrote:
 Is it possible that you're running traceview with a wrong trace file?
 I don't use the emulator so it might be an emulator-related thing but
 so far the tracing works fine for me w/ the device.

 On Sat, Jan 10, 2009 at 5:26 PM, Al alcapw...@googlemail.com wrote:

  I ran a trace on my app using the Debug class, but it seems the new
  trace data isn't loaded by Traceview and somehow only the old data is
  shown. I've recreated the sdcard, wiped the emulator and created a new
  launch config (in Eclipse). I also changed my package name but
  traceview still shows the old data with the old package name. Logcat
  shows it writes the data fine to /sdcard but for some reason, the new
  info isn't shown.

  Any ideas what would cause this?
--~--~-~--~~~---~--~~
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] Change linear layout programmatically - problem

2009-01-10 Thread EvgenyV

Hi!

I'm trying to change height layout from wrap_content to
fill_parent from code. Using landscape mode.
public class BBB extends Activity
{
   @Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.bbb);
LinearLayout layout = 
(LinearLayout)findViewById(R.id.mainZZZ);

LayoutParams params = new LayoutParams
(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
layout.setLayoutParams(params);
   }
}
I have bbb.xml layout file
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:id=@+id/mainZZZ
android:layout_width=fill_parent
android:layout_height=wrap_content
/LinearLayout

Why the activity can't be loaded after run-time changes?
Missing I something?

Thanks in advance,
Evgeny

Stack error:
01-10 21:53:41.570: WARN/dalvikvm(1680): threadid=3: thread exiting
with uncaught exception (group=0x40010e28)
01-10 21:53:41.581: ERROR/AndroidRuntime(1680): Uncaught handler:
thread main exiting due to uncaught exception
01-10 21:53:41.841: ERROR/AndroidRuntime(1680):
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.LinearLayout.measureVertical(LinearLayout.java:323)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.View.measure(View.java:6621)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.View.measure(View.java:6621)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.LinearLayout.measureVertical(LinearLayout.java:461)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.View.measure(View.java:6621)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.View.measure(View.java:6621)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.ViewRoot.performTraversals(ViewRoot.java:620)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.os.Handler.dispatchMessage(Handler.java:88)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.os.Looper.loop(Looper.java:123)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
android.app.ActivityThread.main(ActivityThread.java:3742)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
java.lang.reflect.Method.invokeNative(Native Method)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
java.lang.reflect.Method.invoke(Method.java:515)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
dalvik.system.NativeStart.main(Native Method)




--~--~-~--~~~---~--~~
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: Change linear layout programmatically - problem

2009-01-10 Thread hmmm

Might it be because as stated in the docs for setLayoutParams() These 
supply parameters to the parent of this view specifying how it should be 
arranged. and in this case there's no parent of the view, so the attempted 
operation is not valid.
You might want to try the same with some child view and probably will 
work...

- Original Message - 
From: EvgenyV evgen...@gmail.com
To: Android Developers android-developers@googlegroups.com
Sent: Sunday, January 11, 2009 1:13 AM
Subject: [android-developers] Change linear layout programmatically - 
problem



 Hi!

 I'm trying to change height layout from wrap_content to
 fill_parent from code. Using landscape mode.
 public class BBB extends Activity
 {
@Override
 public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bbb);
 LinearLayout layout = (LinearLayout)findViewById(R.id.mainZZZ);

 LayoutParams params = new LayoutParams
 (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
 layout.setLayoutParams(params);
}
 }
 I have bbb.xml layout file
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
android:orientation=vertical
android:id=@+id/mainZZZ
android:layout_width=fill_parent
 android:layout_height=wrap_content
 /LinearLayout

 Why the activity can't be loaded after run-time changes?
 Missing I something?

 Thanks in advance,
 Evgeny

 Stack error:
 01-10 21:53:41.570: WARN/dalvikvm(1680): threadid=3: thread exiting
 with uncaught exception (group=0x40010e28)
 01-10 21:53:41.581: ERROR/AndroidRuntime(1680): Uncaught handler:
 thread main exiting due to uncaught exception
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):
 java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:323)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:461)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:620)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.os.Handler.dispatchMessage(Handler.java:88)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.os.Looper.loop(Looper.java:123)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.app.ActivityThread.main(ActivityThread.java:3742)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 java.lang.reflect.Method.invokeNative(Native Method)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 java.lang.reflect.Method.invoke(Method.java:515)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
 (ZygoteInit.java:739)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 dalvik.system.NativeStart.main(Native Method)




  


--~--~-~--~~~---~--~~
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] Database Leak in LogCat - SQLiteDatabase, Cursor, Lifecycle

2009-01-10 Thread 3D

In LogCat I keep getting Database Leak found.  The 'tag' is Database
and the 'message' is Leak found.  And its followed by many lines of
red in LogCat.

I'm using an SQLiteDatabase and I access it from two Activities and
one Service.  In the Service I explicitly close both the cursor and
then the database since I can't use startManagingCursor in there.  In
both Activities I open the database in both onCreate and onResume and
close in onPause.  In one Activity I also use a cursor with
startManagingCursor to manage that for me.

So what is going on here?  My app seems to be working almost all the
time but the Database Leak found is very disconcerting.  Thanks in
advance.
--~--~-~--~~~---~--~~
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: Change linear layout programmatically - problem

2009-01-10 Thread Evgeny V
Actually I have tried first to change it for any child view.Same result...

On Sun, Jan 11, 2009 at 12:42 AM, hmmm akul...@mail.ru wrote:


 Might it be because as stated in the docs for setLayoutParams() These
 supply parameters to the parent of this view specifying how it should be
 arranged. and in this case there's no parent of the view, so the attempted
 operation is not valid.
 You might want to try the same with some child view and probably will
 work...

 - Original Message -
 From: EvgenyV evgen...@gmail.com
 To: Android Developers android-developers@googlegroups.com
 Sent: Sunday, January 11, 2009 1:13 AM
 Subject: [android-developers] Change linear layout programmatically -
 problem


 
  Hi!
 
  I'm trying to change height layout from wrap_content to
  fill_parent from code. Using landscape mode.
  public class BBB extends Activity
  {
 @Override
  public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.bbb);
  LinearLayout layout = (LinearLayout)findViewById(R.id.mainZZZ);
 
  LayoutParams params = new LayoutParams
  (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
  layout.setLayoutParams(params);
 }
  }
  I have bbb.xml layout file
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
 android:orientation=vertical
 android:id=@+id/mainZZZ
 android:layout_width=fill_parent
  android:layout_height=wrap_content
  /LinearLayout
 
  Why the activity can't be loaded after run-time changes?
  Missing I something?
 
  Thanks in advance,
  Evgeny
 
  Stack error:
  01-10 21:53:41.570: WARN/dalvikvm(1680): threadid=3: thread exiting
  with uncaught exception (group=0x40010e28)
  01-10 21:53:41.581: ERROR/AndroidRuntime(1680): Uncaught handler:
  thread main exiting due to uncaught exception
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680):
  java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.LinearLayout.measureVertical(LinearLayout.java:323)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.View.measure(View.java:6621)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.View.measure(View.java:6621)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.LinearLayout.measureVertical(LinearLayout.java:461)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.View.measure(View.java:6621)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.View.measure(View.java:6621)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.ViewRoot.performTraversals(ViewRoot.java:620)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.os.Handler.dispatchMessage(Handler.java:88)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.os.Looper.loop(Looper.java:123)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  android.app.ActivityThread.main(ActivityThread.java:3742)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  java.lang.reflect.Method.invokeNative(Native Method)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  java.lang.reflect.Method.invoke(Method.java:515)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
  (ZygoteInit.java:739)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
  01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
  dalvik.system.NativeStart.main(Native Method)
 
 
 
 
  


 


--~--~-~--~~~---~--~~
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: Need help working with xml layout

2009-01-10 Thread Faber Fedor
On Sat, Jan 10, 2009 at 3:47 PM, Brad A hashbro...@gmail.com wrote:


 Related, when specifying a button, is there a way to just have the
 button dynamically size to whatever text is holds?


In theory 'android:layout_width=wrap_contents' is supposed to do precisely
that, but it's not working for me at the mo'.



-- 

Faber Fedor
Cloud Computing New Jersey
http://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] Re: Need help working with xml layout

2009-01-10 Thread Brad A

Yes, it's frustrating to say the least.  Hard to understand why it
makes certain UI decisions.  BTW - in your code example you put
wrap_contents.  The actual property value is wrap_content.  Not
sure if that was just typed in the email or if you have that error in
your code.

OK - So I got my initial layout problems fixed by using relative
layouts, but I'm still having problems with getting the TextView to
wrap properly.

Here is the new layout...

?xml version=1.0 encoding=utf-8?

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=horizontal
ImageView android:id=@+id/offerImage android:layout_width=75sp
android:layout_height=75sp android:layout_margin=5sp /
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=wrap_content
android:layout_height=fill_parent
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=wrap_content
android:layout_height=fill_parent
android:layout_centerVertical=true 
android:orientation=vertical
android:background=@drawable/red
TextView android:id=@+id/productName
android:layout_width=120sp 
android:layout_height=wrap_content
android:textSize=16sp 
android:textColor=@color/screen_black
android:background=@drawable/blue/
TextView android:id=@+id/salesPitch
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_marginTop=5sp 
android:layout_marginBottom=5sp
android:textColor=#80ff 
android:text=Coming June 2009!/
/LinearLayout
/RelativeLayout
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=wrap_content
android:layout_height=fill_parent android:background=@drawable/
green

CheckBox android:id=@+id/favorite 
style=?android:attr/starStyle
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_marginLeft=5sp 
android:layout_marginRight=5sp
android:layout_centerVertical=true
android:layout_alignParentRight=true /
Button android:id=@+id/buy 
android:layout_height=wrap_content
android:layout_width=70sp android:autoText=true
android:layout_toLeftOf=@id/favorite
android:layout_centerVertical=true android:background=@drawable/
yellow
android:padding=0sp /

/RelativeLayout
/LinearLayout

Right now I have to set a fixed with for the TextView.  If I set it to
wrap_content, then long text will blast through the relative layout on
the right, so the button and checkbox are not even shown on the
screen.
I've played with having the right-side layout set to fill_parent, but
that ends up taking way more space than it needs and the TextView
won't even display.

Here's what I need...
Button and CheckBox on right side get as much space as needed, Image
on left takes space it needs, Layout in the middle uses the remaining
space and wraps text as needed.  Doesn't seem like that should be so
hard.

On Jan 10, 5:04 pm, Faber Fedor faberfe...@gmail.com wrote:
 On Sat, Jan 10, 2009 at 3:47 PM, Brad A hashbro...@gmail.com wrote:

  Related, when specifying a button, is there a way to just have the
  button dynamically size to whatever text is holds?

 In theory 'android:layout_width=wrap_contents' is supposed to do precisely
 that, but it's not working for me at the mo'.

 --

 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] Re: Common code with Eclipse

2009-01-10 Thread gymshoe

1) I think this problem is solely related to using external JAR's.
I tried to do reference an external JAR for the first time, and got
exactly the same error.  If you have solved this issue, please post.

2) Sorry, don't know  about this.

Thanks,
JIm




On Nov 19 2008, 2:50 pm, Alvin Yates mamboth...@gmail.com wrote:
 I'm making a new project where I'm attempting to share onlycommon
 Javacode(i.e. no Android classes used) that handle boring stuff like
 data structures, data formatting, and XML parsing from my previous
 Android app.  You know, stuff that I would eventually like to go back
 and refactor to be properly done.

 I had an issue with making anEclipselibrary and importing that into
 a project (Runtime validation errors, which I solved by importing each
 JAR file for HTTP MIME separately), and I seem to be having an equally
 lame issue right now.  Adding the previous project's source to my
 build path gives this error:

 [2008-11-19 12:24:58 - Dex Loader] Unable to execute dex: null
 [2008-11-19 12:24:58 - MyApp] Conversion to Dalvik format failed:
 Unable to execute dex: null

 So a few questions come to mind:

 1) What is this error referring to?  Is this a problem with my
 Manifest (which is in a different library), or a limitation on how 
 theEclipseplug-in works with the DVM?

 And the more general...

 2) Is creating usercommoncodepossible withinEclipsesuch that
 Dalvik will not cause some error in compile/runtime validation?
--~--~-~--~~~---~--~~
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] Proper Intent for an image/jpeg picture when using addIntentOptions?

2009-01-10 Thread EboMike

My app deals with tons of pictures that are on an arbitrary location
of the device (typically somewhere on /sdcard, presumed private to the
app). The gallery has a context menu that calls addIntentOptions on
them so you can send them via MMS, use them as contact pictures, etc.

How do I need to set the intent up for that? I set the type to image/
jpeg, because that seems to be the one everybody is looking for.

I put the Bitmap into an extra stream named data, that seemed to
satisfy the Crop Picture intent, but no-one else.

I used Uri.fromFile() onto the File of the image itself, that seemed
to work with the View Picture intent, but not the others.

I tried MediaStore.Images.Media.getContentUri(), but that didn't do
it.

I tried using my own content provider that always returned a _data
column on every query with a pointer to the file, but that didn't work
either, presumably because it didn't like me setting the MIME type to
image/jpeg.

What's the proper way here?

(And, while I'm on the soap box, I hate the decision to not use
addIntentOptions on any of the core apps. Several times, I have wanted
to use an image in the web browser as a contact icon.)
--~--~-~--~~~---~--~~
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: Common code with Eclipse

2009-01-10 Thread EboMike

I've been able to get external JARs for common code (which uses the
android.jar) to work. I'm using a pretty clumsy way and I'm sure
there's a more elegant solution out there, but it works for me.

Since it's been a while since I set it up, I might not remember the
exact steps. Basically, I created a new Java project (I forgot which
option precisely I used), but it's not an Android-specific project -
it does not have the Android builders.

In the project's settings, I added android.jar as an external JAR in
the Java Build Path.

With that, I'm able to write code that uses the Android SDK which is
compiled and error-checked as I type. Now here is the clumsy part.

When I want to use it in my actual project, I choose File (or right-
click) - Export - Java/JAR File.
Now pick a good place for the .jar file in your repository and export
it. Good news is that Eclipse remembers your settings, so every time
you export, you basically just need to click on Next and Finish.

In your actual Android app, go to the project properties, Java Build
Path, Libraries, and add your .jar file as an external JAR. Now here
is the part that sucks: Every time you change your library, you'll
need to re-export it, then click on the jar in the package explorer,
right-click it and choose Refresh.

Other than that, this works like a charm for me. Again, I'm sure
people who are more familiar with Eclipse are scoffing and have a much
better solution.


On Jan 10, 4:25 pm, gymshoe gyms...@bresnan.net wrote:
 1) I think this problem is solely related to using external JAR's.
 I tried to do reference an external JAR for the first time, and got
 exactly the same error.  If you have solved this issue, please post.

 2) Sorry, don't know  about this.

 Thanks,
 JIm

 On Nov 19 2008, 2:50 pm, Alvin Yates mamboth...@gmail.com wrote:

  I'm making a new project where I'm attempting to share onlycommon
  Javacode(i.e. no Android classes used) that handle boring stuff like
  data structures, data formatting, and XML parsing from my previous
  Android app.  You know, stuff that I would eventually like to go back
  and refactor to be properly done.

  I had an issue with making anEclipselibrary and importing that into
  a project (Runtime validation errors, which I solved by importing each
  JAR file for HTTP MIME separately), and I seem to be having an equally
  lame issue right now.  Adding the previous project's source to my
  build path gives this error:

  [2008-11-19 12:24:58 - Dex Loader] Unable to execute dex: null
  [2008-11-19 12:24:58 - MyApp] Conversion to Dalvik format failed:
  Unable to execute dex: null

  So a few questions come to mind:

  1) What is this error referring to?  Is this a problem with my
  Manifest (which is in a different library), or a limitation on how 
  theEclipseplug-in works with the DVM?

  And the more general...

  2) Is creating usercommoncodepossible withinEclipsesuch that
  Dalvik will not cause some error in compile/runtime validation?


--~--~-~--~~~---~--~~
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: Change linear layout programmatically - problem

2009-01-10 Thread Peli

There's this suspicious line:
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams

Have you tried to explicitly write:
LinearLayout.LayoutParams
instead of just
LayoutParams
whereever it appears?

(because each Layout has their own set of LayoutParams that are not
necessarily compatible with each other).

Peli
www.openintents.org

On 10 Jan., 23:13, EvgenyV evgen...@gmail.com wrote:
 Hi!

 I'm trying to change height layout from wrap_content to
 fill_parent from code. Using landscape mode.
 public class BBB extends Activity
 {
           �...@override
             public void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.bbb);
                         LinearLayout layout = 
 (LinearLayout)findViewById(R.id.mainZZZ);

                 LayoutParams params = new LayoutParams
 (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
                         layout.setLayoutParams(params);
            }}

 I have bbb.xml layout file
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:id=@+id/mainZZZ
     android:layout_width=fill_parent
 android:layout_height=wrap_content
 /LinearLayout

 Why the activity can't be loaded after run-time changes?
 Missing I something?

 Thanks in advance,
 Evgeny

 Stack error:
 01-10 21:53:41.570: WARN/dalvikvm(1680): threadid=3: thread exiting
 with uncaught exception (group=0x40010e28)
 01-10 21:53:41.581: ERROR/AndroidRuntime(1680): Uncaught handler:
 thread main exiting due to uncaught exception
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):
 java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:323)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:461)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.ViewRoot.performTraversals(ViewRoot.java:620)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.os.Handler.dispatchMessage(Handler.java:88)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.os.Looper.loop(Looper.java:123)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 android.app.ActivityThread.main(ActivityThread.java:3742)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 java.lang.reflect.Method.invoke(Method.java:515)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
 (ZygoteInit.java:739)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):     at
 dalvik.system.NativeStart.main(Native Method)
--~--~-~--~~~---~--~~
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] the Trackball and MotionEvents

2009-01-10 Thread blake

I notice that TrackballEvents are different that MotionEvents, and it
makes me wonder what happens on a device that does not support a touch
screen.

Suppose I have an Etch-a-Sketch application, that allows me to do
crude drawings on my screen.  With the G1 phone, I just watch for
MotionEvents and draw them.

Can anyone confirm (or deny) that, on a device that doesn't have a
touch screen, my application will not work?  Or, possibly, might
trackball events appear as MotionEvents, on such a device.

-blake
--~--~-~--~~~---~--~~
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: the Trackball and MotionEvents

2009-01-10 Thread blake

... it appears that I was mistaken.  Both trackball movement and
screen taps generate MotionEvents.  They are delivered completely
differently, though Trackball events through dispatchTrackballEvent,
and touch events through dispatchTouchEvent.

I remain mystified by how the trackball is handled.  It begins to look
as if it generates MotionEvents exactly as the touch screen does.
Presumably, clicking it generates a KEYCODE_DPAD_CENTER event.  How do
you generate a KEYCODE_DPAD_UP on, e.g., a G1?

-blake


On Jan 10, 4:40 pm, blake blake.me...@gmail.com wrote:
 I notice that TrackballEvents are different that MotionEvents, and it
 makes me wonder what happens on a device that does not support a touch
 screen.

 Suppose I have an Etch-a-Sketch application, that allows me to do
 crude drawings on my screen.  With the G1 phone, I just watch for
 MotionEvents and draw them.

 Can anyone confirm (or deny) that, on a device that doesn't have a
 touch screen, my application will not work?  Or, possibly, might
 trackball events appear as MotionEvents, on such a device.

 -blake
--~--~-~--~~~---~--~~
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: Need help working with xml layout

2009-01-10 Thread Brad A

BTW Faber - Did get button to resize according to the text, use
android:layout_width=wrap_content  and then and explicit padding, ie
android:padding=10sp

On Jan 10, 5:53 pm, Brad A hashbro...@gmail.com wrote:
 Yes, it's frustrating to say the least.  Hard to understand why it
 makes certain UI decisions.  BTW - in your code example you put
 wrap_contents.  The actual property value is wrap_content.  Not
 sure if that was just typed in the email or if you have that error in
 your code.

 OK - So I got my initial layout problems fixed by using relative
 layouts, but I'm still having problems with getting the TextView to
 wrap properly.

 Here is the new layout...

 ?xml version=1.0 encoding=utf-8?

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
         android:layout_width=fill_parent
 android:layout_height=fill_parent
         android:orientation=horizontal
         ImageView android:id=@+id/offerImage android:layout_width=75sp
                 android:layout_height=75sp android:layout_margin=5sp /
         RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
                 android:layout_width=wrap_content
 android:layout_height=fill_parent
                 LinearLayout 
 xmlns:android=http://schemas.android.com/apk/res/
 android
                         android:layout_width=wrap_content
 android:layout_height=fill_parent
                         android:layout_centerVertical=true 
 android:orientation=vertical
 android:background=@drawable/red
                         TextView android:id=@+id/productName
                                 android:layout_width=120sp 
 android:layout_height=wrap_content
                                 android:textSize=16sp 
 android:textColor=@color/screen_black
 android:background=@drawable/blue/
                         TextView android:id=@+id/salesPitch
 android:layout_width=wrap_content
                                 android:layout_height=wrap_content
                                 android:layout_marginTop=5sp 
 android:layout_marginBottom=5sp
                                 android:textColor=#80ff 
 android:text=Coming June 2009!/
                 /LinearLayout
         /RelativeLayout
         RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
                 android:layout_width=wrap_content
 android:layout_height=fill_parent android:background=@drawable/
 green
                 
                 CheckBox android:id=@+id/favorite 
 style=?android:attr/starStyle
                         android:layout_width=wrap_content
 android:layout_height=wrap_content
                         android:layout_marginLeft=5sp 
 android:layout_marginRight=5sp
                         android:layout_centerVertical=true
 android:layout_alignParentRight=true /
                 Button android:id=@+id/buy 
 android:layout_height=wrap_content
                         android:layout_width=70sp android:autoText=true
                         android:layout_toLeftOf=@id/favorite
 android:layout_centerVertical=true android:background=@drawable/
 yellow
                         android:padding=0sp /

         /RelativeLayout
 /LinearLayout

 Right now I have to set a fixed with for the TextView.  If I set it to
 wrap_content, then long text will blast through the relative layout on
 the right, so the button and checkbox are not even shown on the
 screen.
 I've played with having the right-side layout set to fill_parent, but
 that ends up taking way more space than it needs and the TextView
 won't even display.

 Here's what I need...
 Button and CheckBox on right side get as much space as needed, Image
 on left takes space it needs, Layout in the middle uses the remaining
 space and wraps text as needed.  Doesn't seem like that should be so
 hard.

 On Jan 10, 5:04 pm, Faber Fedor faberfe...@gmail.com wrote:

  On Sat, Jan 10, 2009 at 3:47 PM, Brad A hashbro...@gmail.com wrote:

   Related, when specifying a button, is there a way to just have the
   button dynamically size to whatever text is holds?

  In theory 'android:layout_width=wrap_contents' is supposed to do precisely
  that, but it's not working for me at the mo'.

  --

  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] Re: Low on space

2009-01-10 Thread info.sktechnol...@gmail.com

Go to Settings - Applications - Manage Applications
Use the hardware Menu button and Sort By Size.
Near the top you will probably find Package Installer.
If it is large, choose it and then Clear Data

I had this problem too, until I figured it out.

On Jan 10, 3:43 pm, Stoyan Damov stoyan.da...@gmail.com wrote:
 Hi guys,

 I own a G1 and am using it for development.
 I have the phone for about a month now and today I got this
 notification Low on space with the message Phone storage space is
 getting low.

 I only have a few programs installed and these take about 4MB.
 I've deleted the browser's cache, and can't figure out why the storage
 has become so low. I only got 7MB free!!! (btw out of how much?!!? I
 can see how much free space I got but out of how much, how can I find
 out?)
 My guess is that it might be something related to the fact that I
 upload my own app pretty often to the device to debug it and it might
 have generated some error logs or something. I don't have a clue.

 Please, help! :)

 Cheers,
 Stoyan

 P.S. For those who read both the beginners and devs lists, sorry for
 the cross post, I'm getting desperate!
--~--~-~--~~~---~--~~
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: Change linear layout programmatically - problem

2009-01-10 Thread hmmm

I've tried but the same result. Now in DDMS log I have:

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams



- Original Message - 
From: Peli peli0...@googlemail.com
To: Android Developers android-developers@googlegroups.com
Sent: Sunday, January 11, 2009 3:39 AM
Subject: [android-developers] Re: Change linear layout programmatically - 
problem



There's this suspicious line:
java.lang.ClassCastException: android.view.ViewGroup$LayoutParams

Have you tried to explicitly write:
LinearLayout.LayoutParams
instead of just
LayoutParams
whereever it appears?

(because each Layout has their own set of LayoutParams that are not
necessarily compatible with each other).

Peli
www.openintents.org

On 10 Jan., 23:13, EvgenyV evgen...@gmail.com wrote:
 Hi!

 I'm trying to change height layout from wrap_content to
 fill_parent from code. Using landscape mode.
 public class BBB extends Activity
 {
 @Override
 public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.bbb);
 LinearLayout layout = (LinearLayout)findViewById(R.id.mainZZZ);

 LayoutParams params = new LayoutParams
 (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
 layout.setLayoutParams(params);
 }}

 I have bbb.xml layout file
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
 android:orientation=vertical
 android:id=@+id/mainZZZ
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 /LinearLayout

 Why the activity can't be loaded after run-time changes?
 Missing I something?

 Thanks in advance,
 Evgeny

 Stack error:
 01-10 21:53:41.570: WARN/dalvikvm(1680): threadid=3: thread exiting
 with uncaught exception (group=0x40010e28)
 01-10 21:53:41.581: ERROR/AndroidRuntime(1680): Uncaught handler:
 thread main exiting due to uncaught exception
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680):
 java.lang.ClassCastException: android.view.ViewGroup$LayoutParams
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:323)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.measureVertical(LinearLayout.java:461)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.LinearLayout.onMeasure(LinearLayout.java:275)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2791)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.widget.FrameLayout.onMeasure(FrameLayout.java:208)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.View.measure(View.java:6621)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewRoot.performTraversals(ViewRoot.java:620)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.os.Handler.dispatchMessage(Handler.java:88)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.os.Looper.loop(Looper.java:123)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 android.app.ActivityThread.main(ActivityThread.java:3742)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 java.lang.reflect.Method.invokeNative(Native Method)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 java.lang.reflect.Method.invoke(Method.java:515)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
 (ZygoteInit.java:739)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 01-10 21:53:41.841: ERROR/AndroidRuntime(1680): at
 dalvik.system.NativeStart.main(Native Method)


--~--~-~--~~~---~--~~
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: Suggestions for Image Libraries to use on Android.

2009-01-10 Thread Ryan Moulton

Thanks a ton, that's exactly the sort of thing I'm looking for.

On Jan 10, 2:32 am, ams163 shahbaz.kha...@gmail.com wrote:
 Maybe:

 http://code.google.com/p/jjil/

 http://code.google.com/p/jjil/wiki/SequencesAndLadders

 On Jan 9, 5:37 am, Ryan Moulton ryanmoul...@gmail.com wrote:

  I'm looking to develop an application for which I need to do
  convolutions and the like on an image. I haven't done image processing
--~--~-~--~~~---~--~~
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: the Trackball and MotionEvents

2009-01-10 Thread Dianne Hackborn
The framework translates raw trackball events into DPAD events if nobody
consumes the trackball event.

At this time Android only supports devices that have a touch screen.  The
trackball is optional, and can be replaced by a DPAD.

On Sat, Jan 10, 2009 at 5:21 PM, blake blake.me...@gmail.com wrote:


 ... it appears that I was mistaken.  Both trackball movement and
 screen taps generate MotionEvents.  They are delivered completely
 differently, though Trackball events through dispatchTrackballEvent,
 and touch events through dispatchTouchEvent.

 I remain mystified by how the trackball is handled.  It begins to look
 as if it generates MotionEvents exactly as the touch screen does.
 Presumably, clicking it generates a KEYCODE_DPAD_CENTER event.  How do
 you generate a KEYCODE_DPAD_UP on, e.g., a G1?

 -blake


 On Jan 10, 4:40 pm, blake blake.me...@gmail.com wrote:
  I notice that TrackballEvents are different that MotionEvents, and it
  makes me wonder what happens on a device that does not support a touch
  screen.
 
  Suppose I have an Etch-a-Sketch application, that allows me to do
  crude drawings on my screen.  With the G1 phone, I just watch for
  MotionEvents and draw them.
 
  Can anyone confirm (or deny) that, on a device that doesn't have a
  touch screen, my application will not work?  Or, possibly, might
  trackball events appear as MotionEvents, on such a device.
 
  -blake
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
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: Touch *extremely* expensive performance-wise

2009-01-10 Thread Dianne Hackborn
Thanks, glad to hear it helped.  Sorry I was slow responding to your last
detailed message.

Fwiw, you should generally avoid trying to directly control scheduling.  Let
the kernel schedule the threads as needed; the only issue you had here was
that your main thread was using as much CPU as it could get, since it was
continually processing touch events, so the kernel would schedule 50/50
between that and the game thread.  Simply reducing the work being done by
the main thread (by our little hacky sleep solution) is probably the best
way to fix things.

On Sat, Jan 10, 2009 at 1:19 PM, Stoyan Damov stoyan.da...@gmail.comwrote:


 Dianne, I want to thank you again for your advice - it actually
 helped. I process at most 10 touch movement events per second (good
 enough for the app) and sleep the UI thread after the moves - this did
 boost the second thread enough so that most of the app's time is spent
 in physics updates and drawing.

 Thanks again,
 Stoyan

 On Sat, Jan 10, 2009 at 3:51 AM, Stoyan Damov stoyan.da...@gmail.com
 wrote:
  I'll add that the time consumed by my view's onFingerMove is 2/3 of
  the time to call (MotionEvent.getAction + .getX() + .getY()) - that
  is, I'm pretty sure I'm not doing anything funny in my touch event's
  handler.
 
  On Sat, Jan 10, 2009 at 3:14 AM, Stoyan Damov stoyan.da...@gmail.com
 wrote:
  On Sat, Jan 10, 2009 at 12:49 AM, Dianne Hackborn hack...@android.com
 wrote:
  On Fri, Jan 9, 2009 at 1:22 PM, Stoyan Damov stoyan.da...@gmail.com
 wrote:
 
  I do yield to the main thread by calling mainActivity.runOnUiThread
  w/ a no-op (cached) runnable once per second but I guess that's not
  enough. I'll try increasing that to see if it will make a difference.
  I'd rather run the game @ 40 fps by losing ~15 fps because of yielding
  than losing ~30 fps because of touch event throttling.
 
  If I am reading that right, that's not a yield, that is just adding
 more CPU
  using work on the main thread. :)  What you want to do is force the
 main
  thread to actually stop running for a bit after processing an event, so
 that
  it isn't using the CPU and your other thread can run and the window
 manager
  doesn't immediately turn around and give you another event with more
 work to
  do.
 
  Now you got me confused :) but let me 1st explain that by yielding I
  meant that the game thread yielded to the UI one.
 
  My confusion (now) is that I thought (after your post) that the main
  UI thread was not given enough time to process touch events and the OS
  was doing something (more work) because of that and was leaving my app
  with less time to work. You're now saying it's the opposite, but that
  can't be the problem because before I added the yields, the game
  thread was running at full speed and the UI was so unresponsive (e.g.
  clicking the Menu button resulted in ANR) that I had to do something
  about it and start yielding to the UI thread from the game one
  occasionally.
 
  However, I realize that you're not really saying to not let the UI
  thread work but to make it unresponsive for a bit every now and then
  (after an event is processed) so that the game thread works more and
  less context switches (made by Android's thread scheduling mechanism,
  not by me marshalling calls) occur. Is that what you're saying?
 
  Now just before I was about to post this, I profiled the game and let
  me share some *very* interesting facts about the touch handling.
 
  I ran the game, touched (which triggers the profile start process),
  and immediately removed my finger from the screen and let the
  profiling finish.
  What I saw in Traceview is that 64.7% of the game's time went in
  drawing (which is great!), 33.8% in the game's update, and
  android.os.Handler.dispatchMessage(Message) takes the funny 0.2% - I'm
  mentioning dispatchMessage here because you'll see a DRASTIC change in
  a second.
 
  I then ran the game, touched the screen and started moving my finger
  without releasing it until the profiling stopped.
  What I saw in Traceview is that 49.1% went in the game's update code,
  only 9% in the draw code and now for the winner -
  Handler.dispatchMessage took 24.7% of the time :O :O :O
  This only makes me think that my assumption that the layers below the
  app are doing something more than expected :(
  I'm yet to find out why would the update vs draw time is 49% to 9%
  (maybe locking the canvas and event handling on the UI thread are
  somewhat related???), but having an overhead of 25% just because I'm
  touching the screen is too much for me.
 
  Cheers
 
 
 
  I'd rather control the priority myself :)
 
  How are you going to control the priority yourself?
 
  Now that you understand what I meant by yielding (that is, not to the
  OS but from the game to the main/UI thread) I guess that question is
  moot.
 
  Cheers
 
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't 

[android-developers] Re: Concern about application file size for publishing due to Media files

2009-01-10 Thread Dianne Hackborn
On Fri, Jan 9, 2009 at 9:35 PM, Mahesh Vaghela mah...@indianic.com wrote:

 *Friends, is there any way by which we can directly put our mp3 files on
 sd card, just at the time of installation?*


Sorry, not at this point.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
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: Concern about application file size for publishing due to Media files

2009-01-10 Thread Dianne Hackborn
On Fri, Jan 9, 2009 at 9:49 PM, Mahesh Vaghela mah...@indianic.com wrote:

 Can you please comment on why there is very limited (70mb) space available
 for developers.


Because that is how much space remains on the G1's internal flash after
taking out the space needed for the operating system and such.


 If this is the limitation, how can a developer think for providing music
 and video?


The best solution right now is I think to download your large data after
installing.

I know at google you all must have think on this. and if there is way by
 which developer can directly put their audio and video file on sd card at
 the time of application download than its enough for we all.


Sorry, this isn't possible at this point.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
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: DRAG AND DROP

2009-01-10 Thread Dianne Hackborn
Fwiw, changing layout parameters is a really inefficient way to do
animations on the screen.  I would strongly suggest looking at the launcher
code and doing something inspired by that.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~-~--~~~---~--~~
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: WebView: Need help with local file Urls in the browser

2009-01-10 Thread Fred Grott(shareme)

no..my html files n my apk are referenced as

href=file:///android_asset/filename.html

image use the same base url


On Jan 10, 2:05 pm, Mariano Kamp mariano.k...@gmail.com wrote:
 Hi,

    let's say I write content onto the local filesystem using  
 Context.openFileOutput(). For the sake of this example one file IS  
 index.html and one IS image.png. The former references the latter in  
 the html code.

    How can I get the browser to display the content? I tried many  
 different ways and failed so far.

    I can't just use the url: file:///data/data/com.myapp/files/index.html
 . The browser just says Web page not available. Also when loading  
 the content of the index.html file directly, it does not show the  
 image. Like this:
 contentWebView.loadDataWithBaseURL(file:///data/data/com.myapp/files/index.html
 , htmlHello, World!img src=\image.png\//html, text/html,  
 utf-8, null);

    I wrote the content with Context.MODE_WORLD_READABLE.

    Any ideas? I read somewhere that I should provide a WebClient and  
 override shouldOverrideUrlLoading for whatever reason. But that  
 doesn't work at all for me. This method is never called (android-sdk-
 mac_x86-1.0_r2).

    I guess I can try to ask the user to turn off shared access for the  
 sdcard and use that, but that's really not what I want. In a pinch  
 though ... any ideas?

    Also when using Context.openFileInput/Output I can't use folders,  
 right? Any ideas if the file system slows down when I have a thousand  
 small files there?

 Cheers,
 Mariano
--~--~-~--~~~---~--~~
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: any other method

2009-01-10 Thread Fred Grott(shareme)

Ed Burnette's Android book..my bias he is a professional peer/friend
of mine..



On Jan 9, 10:56 pm, msmsmukesh msmsmuk...@gmail.com wrote:
 Hi all,Any method to quick to learn the android.
--~--~-~--~~~---~--~~
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: Change linear layout programmatically - problem

2009-01-10 Thread Romain Guy
In this case you to use FrameLayout.LayoutParams. Note that having a
FrameLayout as the parent of your content view is not guaranteed and could
very well change across implementations and/or versions.

On Jan 10, 2009 5:49 PM, hmmm akul...@mail.ru wrote:


I've tried but the same result. Now in DDMS log I have:

java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams

- Original Message - From: Peli peli0...@googlemail.com To:
Android Developers an...

Sent: Sunday, January 11, 2009 3:39 AM Subject: [android-developers] Re:
Change linear layout progra...

There's this suspicious line: java.lang.ClassCastException:
android.view.ViewGroup$LayoutParams Hav...

--~--~-~--~~~---~--~~
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 is causing Service not registered from unbind(service)?

2009-01-10 Thread Ricardo Rabelo

Dear,

On Fri, Dec 12, 2008 at 7:19 PM, Dianne Hackborn hack...@android.com wrote:
 On Fri, Dec 12, 2008 at 3:56 AM, zero zeroo...@googlemail.com wrote:

 o_0''  for real ?!?
 that would mean i'm depending on luck and good faith then
 calling anything on that connection. oh, well. in the garbage
 collector we trust ;-)

 The IBinder communication channel between the application and the service is
 direct, so once you have it you can continue to call it until the service's
 process goes away or the service deliberately decides otherwise.

this is a two way communication?  I'm planning to have an activity
that send data to a remote service and vice-versa (and I need to use a
 Remote Service!).

It is possible to set a callback that allows the activity sends data
to a remote service? (the example with remote service uses callback to
the communication Service - to - Activity).

--~--~-~--~~~---~--~~
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: Common code with Eclipse

2009-01-10 Thread gymshoe

Thanks for the explanation.
This sounds useful for creating reusable, user-created libraries.
I guess my problem is that I was experimenting with importing external
jars which were not android specific. These fail to load (which I
guess should be obvious), with errors described previously.

Jim




On Jan 10, 5:34 pm, EboMike ebom...@gmail.com wrote:
 I've been able to get external JARs for common code (which uses the
 android.jar) to work. I'm using a pretty clumsy way and I'm sure
 there's a more elegant solution out there, but it works for me.

 Since it's been a while since I set it up, I might not remember the
 exact steps. Basically, I created a new Java project (I forgot which
 option precisely I used), but it's not an Android-specific project -
 it does not have the Android builders.

 In the project's settings, I added android.jar as an external JAR in
 the Java Build Path.

 With that, I'm able to write code that uses the Android SDK which is
 compiled and error-checked as I type. Now here is the clumsy part.

 When I want to use it in my actual project, I choose File (or right-
 click) - Export - Java/JAR File.
 Now pick a good place for the .jar file in your repository and export
 it. Good news is that Eclipse remembers your settings, so every time
 you export, you basically just need to click on Next and Finish.

 In your actual Android app, go to the project properties, Java Build
 Path, Libraries, and add your .jar file as an external JAR. Now here
 is the part that sucks: Every time you change your library, you'll
 need to re-export it, then click on the jar in the package explorer,
 right-click it and choose Refresh.

 Other than that, this works like a charm for me. Again, I'm sure
 people who are more familiar with Eclipse are scoffing and have a much
 better solution.

 On Jan 10, 4:25 pm,gymshoegyms...@bresnan.net wrote:



  1) I think this problem is solely related to using external JAR's.
  I tried to do reference an external JAR for the first time, and got
  exactly the same error.  If you have solved this issue, please post.

  2) Sorry, don't know  about this.

  Thanks,
  JIm

  On Nov 19 2008, 2:50 pm, Alvin Yates mamboth...@gmail.com wrote:

   I'm making a new project where I'm attempting to share onlycommon
   Javacode(i.e. no Android classes used) that handle boring stuff like
   data structures, data formatting, and XML parsing from my previous
   Android app.  You know, stuff that I would eventually like to go back
   and refactor to be properly done.

   I had an issue with making anEclipselibrary and importing that into
   a project (Runtime validation errors, which I solved by importing each
   JAR file for HTTP MIME separately), and I seem to be having an equally
   lame issue right now.  Adding the previous project's source to my
   build path gives this error:

   [2008-11-19 12:24:58 - Dex Loader] Unable to execute dex: null
   [2008-11-19 12:24:58 - MyApp] Conversion to Dalvik format failed:
   Unable to execute dex: null

   So a few questions come to mind:

   1) What is this error referring to?  Is this a problem with my
   Manifest (which is in a different library), or a limitation on how 
   theEclipseplug-in works with the DVM?

   And the more general...

   2) Is creating usercommoncodepossible withinEclipsesuch that
   Dalvik will not cause some error in compile/runtime validation?- 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] Recording Audio

2009-01-10 Thread Tez

Hi,

I want to record audio from the emulator using the mic. Can anyone
send me some sample code on how to do this.
Also, I want to know whether it is possible to redirect this mic o/p
to a memory buffer or network socket.

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: any other method

2009-01-10 Thread msmsmukesh
Hi Fred,I want android book. Send it to me in mail.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---