[android-developers] Re: How to install Sense UI into my HTC Magic

2011-04-24 Thread Paul Turchenko
What you are asking for is custom firmware. It IS possible to have HTC
Sense on your device (I had HTC Magic 32B before and it was running
Sense). You should spend couple days making yourself familiar with
rooting, flashing, changing bootloader or/and SPL. Good place to start
is xda dev. forum. These guys rock. Firmware procedures will void your
warranty so be careful.
Honestly, this forum is a bad place to ask questions like that. Go to
xda and read-read-read.

Paul.

On Apr 24, 12:41 am, Nicholas Key nicholaskeythole...@gmail.com
wrote:
 Hi Android Dev group members,

 I've been searching high and low about installing Sense UI into my HTC
 Magic (the one that is loaded with Google ION) but couldn't find any
 relevant search results. This is the closest I could 
 find:http://developer.htc.com/google-io-device.html

 There are several terms that I do not understand, namely - root,
 flash, wipe. My question would be, is it even remotely possible to
 install Sense UI into my HTC Magic (I got that Magic phone from Google
 IO conference).

 Nicholas

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


Re: [android-developers] Re: WebView and geolocation questions

2011-04-24 Thread Moose
Further testing: 
Phone that already worked (with sim card) works without sim card over wifi 
(or gps?). 
Other phone does not work with or without sim card.
XOOM - still doesn't work
Got friend to install apk - they say it works on their phone as well.

gps 'in use' icon never flashes on any of the devices

I am completely baffled by 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: How to install Sense UI into my HTC Magic

2011-04-24 Thread Nicholas Key
Thank you Paul.

I initially thought that it's not possible at all to install custom
firmware into Google's HTC Magic.
I'll spend some time looking at xda forum.

Nicholas




On Apr 23, 11:19 pm, Paul Turchenko paul.turche...@gmail.com wrote:
 What you are asking for is custom firmware. It IS possible to have HTC
 Sense on your device (I had HTC Magic 32B before and it was running
 Sense). You should spend couple days making yourself familiar with
 rooting, flashing, changing bootloader or/and SPL. Good place to start
 is xda dev. forum. These guys rock. Firmware procedures will void your
 warranty so be careful.
 Honestly, this forum is a bad place to ask questions like that. Go to
 xda and read-read-read.

 Paul.

 On Apr 24, 12:41 am, Nicholas Key nicholaskeythole...@gmail.com
 wrote:







  Hi Android Dev group members,

  I've been searching high and low about installing Sense UI into my HTC
  Magic (the one that is loaded with Google ION) but couldn't find any
  relevant search results. This is the closest I could 
  find:http://developer.htc.com/google-io-device.html

  There are several terms that I do not understand, namely - root,
  flash, wipe. My question would be, is it even remotely possible to
  install Sense UI into my HTC Magic (I got that Magic phone from Google
  IO conference).

  Nicholas

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


Re: [android-developers] Click event on Edit-Text's Right Drawable.

2011-04-24 Thread Hyvi
I want to test .. but failure ..
Java code

 public void onCreate(Bundle savedInstanceState)
  {
   super.onCreate(savedInstanceState);
  setContentView(new CustomEditTextActivity(this));
   }

error ouput :
E/AndroidRuntime(  296): java.lang.RuntimeException: Unable to instantiate
activity
ComponentInfo{com.gliese.android/com.gliese.android.CustomEditTextActivity}:
java.lang.InstantiationException: com.gliese.android.CustomEditTextActivity
E/AndroidRuntime(  296): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
E/AndroidRuntime(  296): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(  296): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(  296): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(  296): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  296): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  296): at
android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(  296): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(  296): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  296): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(  296): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(  296): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  296): Caused by: java.lang.InstantiationException:
com.gliese.android.CustomEditTextActivity
E/AndroidRuntime(  296): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime(  296): at java.lang.Class.newInstance(Class.java:1429)
E/AndroidRuntime(  296): at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
E/AndroidRuntime(  296): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
E/AndroidRuntime(  296): ... 11 more

 Caused by: java.lang.InstantiationException:
com.gliese.android.CustomEditTextActivity ..

can  anyone help me ?
2011/4/23 Sunil Lakhiyani slakhiyaniandr...@gmail.com

 Hello Developers,

 I have one Edit Text with right drawable.
 The xml code is

 TextView android:id=@+id/trip_txt_to
 android:layout_width=wrap_content android:layout_height=wrap_content
  android:text=@string/addname android:layout_alignParentLeft=true
 android:textStyle=bold android:textColor=@color/black
  android:typeface=normal android:padding=10dp
 android:layout_below=@+id/lineview1 /

 test.ui.CustomEditTextActivity
 android:id=@+id/nameofpersonr android:layout_height=wrap_content
  android:hint=@string/hint
 android:layout_toRightOf=@+id/name android:textColor=@color/black
  android:typeface=normal
 android:layout_below=@+id/lineview1
 android:drawableRight=@drawable/icon
 android:layout_width=180dp
 /test.ui.CustomEditTextActivity

 ImageView android:id=@+id/clearnameimage
  android:layout_alignParentRight=true
 android:layout_width=wrap_content
 android:layout_height=wrap_content android:scaleType=fitXY
  android:layout_below=@+id/lineview1
 android:src=@drawable/deleteicon android:padding=5dp/


 and CustomEditTextActivity.java

 public class CustomEditTextActivity extends EditText {
 private Drawable rightSideDrawable;
  private Rect rectangleBounds;

 public CustomEditTextActivity(Context context, AttributeSet attributeSet,
  int defStyle) {

 super(context, attributeSet, defStyle);
  }

 public CustomEditTextActivity(Context context, AttributeSet attributeSet) {
  super(context, attributeSet);
 }

 public CustomEditTextActivity(Context context) {
  super(context);
 }

 @Override
  public void setCompoundDrawables(Drawable left, Drawable top,
 Drawable right, Drawable bottom) {
  if (right != null) {
 rightSideDrawable = right;
  }
 super.setCompoundDrawables(left, top, right, bottom);
 }

 @Override
 protected void finalize() throws Throwable {
 rightSideDrawable = null;
  rectangleBounds = null;
 super.finalize();
 }

 public Rect getRectBound() {
 return rectangleBounds;
 }

 public Drawable getRightDrawable() {
 return rightSideDrawable;
  }
   // on touch event code i got from some site..
 @Override
 public boolean onTouchEvent(MotionEvent event)
 {

 if(event.getAction() == MotionEvent.ACTION_UP 
 rightSideDrawable!=null)
 {
  rectangleBounds = rightSideDrawable.getBounds();
 final int x = (int)event.getX();
 final int y = (int)event.getY();

 if(x=(this.getRight()-rectangleBounds.width()) 
 x=(this.getRight()-this.getPaddingRight())
  y=this.getPaddingTop() 
 y=(this.getHeight()-this.getPaddingBottom()))
 {
 this.setText();
 event.setAction(MotionEvent.ACTION_CANCEL);//use this to
 prevent the keyboard from coming up
 }
 }
 return 

Re: [android-developers] Click event on Edit-Text's Right Drawable.

2011-04-24 Thread Dianne Hackborn
This kind of stuff:

On Fri, Apr 22, 2011 at 6:33 PM, Sunil Lakhiyani 
slakhiyaniandr...@gmail.com wrote:

  // on touch event code i got from some site..
 @Override
 public boolean onTouchEvent(MotionEvent event)
 {

 if(event.getAction() == MotionEvent.ACTION_UP 
 rightSideDrawable!=null)
 {
  rectangleBounds = rightSideDrawable.getBounds();
 final int x = (int)event.getX();
 final int y = (int)event.getY();

 if(x=(this.getRight()-rectangleBounds.width()) 
 x=(this.getRight()-this.getPaddingRight())
  y=this.getPaddingTop() 
 y=(this.getHeight()-this.getPaddingBottom()))
 {
 this.setText();
 event.setAction(MotionEvent.ACTION_CANCEL);//use this to
 prevent the keyboard from coming up


(Modifying the motion event)

Is the kind of thing that causes apps to break on different platforms or
devices.  It is not at all defined what it means to suddenly modify the
motion event like that.  Just because it happens to do something that you
like doesn't mean it will always do this.

-- 
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, and so won't reply to such e-mails.  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] No google orders results for SDK11

2011-04-24 Thread Droid
I have done several apps that target SDK11 alone (Xoom, Acer tablets)
but I get zero downloads results in my orders pages.

I am absolutely certain that there have been downloads but there are
no results (over 5 popular apps).

Have Google switched off downloads and analytics for SDK11?

-- 
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: seeking with av_seek_frame or url_seek

2011-04-24 Thread Doug
This has nothing to do with Android.  I suspect you should take this
to a FFmpeg forum for better help.

Doug

On Apr 22, 5:06 am, Ece OZMEN eceooz...@gmail.com wrote:
 Hi, I try to save the keyframes. I found which frames are keyframes.
 I wrote two function to seek where the keyframes are. One of them is
 with av_seek_frame and the other is with url_seek ..but none of them
 work.

-- 
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: Codecs on Android

2011-04-24 Thread Doug
On Apr 21, 2:59 pm, Impy wynnem...@gmail.com wrote:
 I'll start here...and I'm already cringing from the laughter and
 sneering I know I'll receive. I don't know a lot about how codecs work
 except that they are language coded drivers for media, usually audio
 and video. I'm interested in protocol H.323 because I'm working on a
 video solution for Deaf people.

 1. If I want to video chat (and really I don't care about the chat/
 voice part) with someone on an android tablet - I would need the
 codecs defined under the H.323 protocol such as Video codecs: H.261, H.
 263, H.264 installed. Is that correct?

You can use any codec you want, if you provide the implementation.

 2. Assuming that 1 is correct - then a video camera and software such
 as Yahoo video chat or Gmail video chat (and I'm just using them as
 examples) that interfaces with h.323 should work on the tablet. Is
 that correct?
 (I would mention Skype but I understand the android version doesn't
 support video yet.)

If the hardware/software on both sides of the chat support the same
codecs, then you can use whatever you want.

 3. Assuming 1 and 2 are correct - how do I go about getting the
 android version of the codecs installed on Android version 2.2? I saw
 one program on the market that claimed to come with the codecs - but
 the software was a paid version. I'd like to experiment for free. :-)
 Is there such a thing as codecs that can be downloaded to the
 Android?
 (I've done this with the pc.)

Each device may be slightly different.  Check its documentation.  Go
here for an understanding of universally supported media types (if
you're using Android APIs for interacting with media):

 Where can I go to learn more about how to see if codecs are installed
 on Android?

http://developer.android.com/guide/appendix/media-formats.html

Again, you can always provide your own codecs through some third party
library that operates independently of Android APIs.

Doug

-- 
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] Wallpaper size

2011-04-24 Thread Simon Platten
On Android 1.6 my wallpaper applications resize the wallpapers correctly,
however on Android 2.1 the resizing doesn't work, its the same on the
emulator.

I've tried using both the Matrix and Bitmap.createScaledBitmap both do
exactly the same and work find on 1.6.  Can anyone explain what is happing
and why these routines don't work on Android 2.1?

I start off by getting the device screen size using:

Display display = app.getWindowManager().
getDefaultDisplay();
m_intScrWidth = display.getWidth();
m_intScrHeight = display.getHeight();

I load the image from a resource with:

m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
m_intImgWidth  = m_bmpImage.getWidth();
m_intImgHeight = m_bmpImage.getHeight();
m_fltSFbyHeight = (float)m_intScrHeight / (float)m_intImgWidth;

Then to scale the image:

m_intFinalWidth  = (int)((float)m_intImgWidth * m_fltSFbyHeight);
m_intFinalHeight = (int)((float)m_intImgHeight * m_fltSFbyHeight);

Thank you,
Simon

-- 
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: 'E-Mail Developer' button creating a lot of spam?

2011-04-24 Thread Doug
On Apr 23, 9:59 am, Matt M matthew.mag...@gmail.com wrote:
 I added an E-Mail Developer button to my application and ever since I
 get random e-mails throughout the day that either have an empty
 message body or just one or two words in a different language (looks
 like Russian or something similar, sometimes an Asian language).

You're probably making it too easy for your users to accidentally
contact you.  Try making it clear that what they are about to do is
send an email, and give them the option to back out if that's not
really what they want to do.  Just launching an intent to send an
email (through some other installed app or otherwise) might be too
confusing for users who aren't expecting that.

I have a popular app with a feedback option that is buried in a menu,
and only very rarely do I get empty emails.  I also populate the
subject and body text with some info to help the user understand what
they are doing.

Doug

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


Re: [android-developers] How to disable key press events!!

2011-04-24 Thread Pratik Prajapati
Hi,

Do you mean, I should implement an IOCTL in key board sub-system of linux
that should do report key pressed event to upper layer.
This ioctl can be fired by a native call and my .apk call it with jni
interface?
Does it makes sense? or any better idea?


On Sat, Apr 23, 2011 at 7:45 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Sat, Apr 23, 2011 at 9:51 AM, Pratik Prajapati
 pratik.prajap...@gmail.com wrote:
  For the In-flight entertainment kind of device. When ever there is
  any accoutrement to be made, the android based unit must get muted and
 all
  key ( mounted on the device + external key pad ) must get disabled for
 that
  much time.
  Any effective solution?

 An in-flight entertainment kind of device is custom hardware running
 custom firmware and therefore will solve this problem via that custom
 firmware. Android SDK applications should not be involved in the
 process at all.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android 3.0 Programming Books: http://commonsware.com/books

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




-- 
Regards,
Pratik Prajapati

-- 
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: Progress Bar

2011-04-24 Thread nirm
Hi,
Thanks for the help

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


[android-developers] Building shapes with GL_TRIANGLE_STRIP or GL_TRIANGLE?

2011-04-24 Thread MobileVisuals
What is the best approach for building 3d shapes, GL_TRIANGLE_STRIP or
GL_TRIANGLE with indices? They say on the opengl.org forum

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflatNumber=295940#Post295940

 that it is better to use GL_TRIANGLE with indices.

-- 
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] Problem installing android sdk in ubuntu 10.10

2011-04-24 Thread Saurav
Hi all,

I am trying to install android sdk, but the for every try, the android sdk
manager gives this error message:

Failed to fetch URL
http://dl-ssl.google.com/android/repository/addons_list.xml, reason:
Connection timed out

It may look silly, but has anybody solved this? And I have tried with and
without https!

Thanks in advance.


Regards,
Saurav Mukherjee.

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

Re: [android-developers] How to disable key press events!!

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 4:51 AM, Pratik Prajapati
pratik.prajap...@gmail.com wrote:
 Do you mean, I should implement an IOCTL in key board sub-system of linux
 that should do report key pressed event to upper layer.
 This ioctl can be fired by a native call and my .apk call it with jni
 interface?
 Does it makes sense? or any better idea?

Well, you are way out of my depth, there. I would recommend you head
over to http://source.android.com and join the relevant lists there
([android-porting] comes to mind), provide a *detailed* description of
what you're building and what you're trying to achieve here, and see
what insights you get.

Once you get out of the SDK, this list isn't the right home for the discussion.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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


Re: [android-developers] Re: WebView and geolocation questions

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 2:28 AM, Moose coatedmo...@gmail.com wrote:
 Further testing:
 Phone that already worked (with sim card) works without sim card over wifi
 (or gps?).
 Other phone does not work with or without sim card.
 XOOM - still doesn't work
 Got friend to install apk - they say it works on their phone as well.
 gps 'in use' icon never flashes on any of the devices
 I am completely baffled by this.

Off the cuff, it feels like a XOOM or Android 3.0 issue.
Unfortunately, we do not have the source code to Android 3.0.

I have no idea how HTML5 geolocation works on the emulator (with DDMS
or telnet as the source of geo fixes). You might try a 2.2 and a 3.0
emulator (note: not 2.3.3 -- buggy) and see what behaviors you see
there. If it works on the 3.0 emulator, then the problem may be
XOOM-specific, and I'd advise you to visit the MOTODEV discussion
boards to provide sample code and explain what you're seeing.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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


[android-developers] how to get the view that is attached to an animation?

2011-04-24 Thread Rakib


here is a pseudoCode

1. View myView = new View();
2. Animation myAnimation = new Animation();
3. myView.startAnimation(myAnimation);   // animation attached to the view
4. View myViewCopy = myAnimation.getAttachedView()

is there any way I can achieve the step in *line number 4*?

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

Re: [android-developers] how to get the view that is attached to an animation?

2011-04-24 Thread Mark Murphy
There is nothing on Animation for that. You will need to track the
View yourself (e.g., data member).

On Sun, Apr 24, 2011 at 8:29 AM, Rakib syed.rakib.al.ha...@gmail.com wrote:
 here is a pseudoCode

 1. View myView = new View();
 2. Animation myAnimation = new Animation();
 3. myView.startAnimation(myAnimation);   // animation attached to the view
 4. View myViewCopy = myAnimation.getAttachedView()

 is there any way I can achieve the step in line number 4?

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



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

-- 
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: Click event on Edit-Text's Right Drawable.

2011-04-24 Thread Zsolt Vasvari
Have 2 Views in your layout next to each other and set their
backgrounds so it looks like you have a single control.

On Apr 24, 7:07 am, Sunil Lakhiyani slakhiyaniandr...@gmail.com
wrote:
 hey Zsolt Vasvari
 can you please explain in detail? and any code or example would be great
 help for me.

 Thanks



 On Fri, Apr 22, 2011 at 8:52 PM, Zsolt Vasvari zvasv...@gmail.com wrote:
  I messed around this for a long time in my app and finally I decided
  that the simplest way was to have a compound control that comprised of
  an EditText and a ImageView.  It works great.

  On Apr 23, 9:33 am, Sunil Lakhiyani slakhiyaniandr...@gmail.com
  wrote:
   Hello Developers,

   I have one Edit Text with right drawable.
   The xml code is

   TextView android:id=@+id/trip_txt_to
   android:layout_width=wrap_content android:layout_height=wrap_content
   android:text=@string/addname android:layout_alignParentLeft=true
   android:textStyle=bold android:textColor=@color/black
   android:typeface=normal android:padding=10dp
   android:layout_below=@+id/lineview1 /

   test.ui.CustomEditTextActivity
   android:id=@+id/nameofpersonr android:layout_height=wrap_content
   android:hint=@string/hint
   android:layout_toRightOf=@+id/name android:textColor=@color/black
   android:typeface=normal
   android:layout_below=@+id/lineview1
   android:drawableRight=@drawable/icon
                                   android:layout_width=180dp
   /test.ui.CustomEditTextActivity

   ImageView android:id=@+id/clearnameimage
   android:layout_alignParentRight=true
  android:layout_width=wrap_content
   android:layout_height=wrap_content android:scaleType=fitXY
   android:layout_below=@+id/lineview1
   android:src=@drawable/deleteicon android:padding=5dp/

   and CustomEditTextActivity.java

   public class CustomEditTextActivity extends EditText {
   private Drawable rightSideDrawable;
   private Rect rectangleBounds;

   public CustomEditTextActivity(Context context, AttributeSet attributeSet,
   int defStyle) {

   super(context, attributeSet, defStyle);

   }

   public CustomEditTextActivity(Context context, AttributeSet attributeSet)
  {
   super(context, attributeSet);

   }

   public CustomEditTextActivity(Context context) {
   super(context);

   }

   @Override
   public void setCompoundDrawables(Drawable left, Drawable top,
   Drawable right, Drawable bottom) {
   if (right != null) {
   rightSideDrawable = right;
    }
   super.setCompoundDrawables(left, top, right, bottom);

   }

   @Override
   protected void finalize() throws Throwable {
   rightSideDrawable = null;
   rectangleBounds = null;
   super.finalize();

   }

   public Rect getRectBound() {
   return rectangleBounds;

   }

   public Drawable getRightDrawable() {
   return rightSideDrawable;}

             // on touch event code i got from some site..
   @Override
       public boolean onTouchEvent(MotionEvent event)
       {

           if(event.getAction() == MotionEvent.ACTION_UP 
   rightSideDrawable!=null)
           {
            rectangleBounds = rightSideDrawable.getBounds();
               final int x = (int)event.getX();
               final int y = (int)event.getY();

               if(x=(this.getRight()-rectangleBounds.width()) 
   x=(this.getRight()-this.getPaddingRight())
                        y=this.getPaddingTop() 
   y=(this.getHeight()-this.getPaddingBottom()))
               {
                   this.setText();
                   event.setAction(MotionEvent.ACTION_CANCEL);//use this to
   prevent the keyboard from coming up
               }
           }
           return super.onTouchEvent(event);
       }

   }

   Now problem is,

   when i open the activity, it shows me keyboard and i can right in edit
  text,
   but as soon as i touch to edit text it launches another activity, i
  called
   it InfoActivity.java. But InfoActivity.java is supposed to be launched
  if
   I click on drawable not on edit text.
   Can you please help me to get click event or touch event on right hand
  side
   drawable, instead of edit text? or is there any other alternative way?
   Also, because of this i can not use this line for keyboard..

  this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STA­­TE_ALWAYS_HIDDEN);

   Can anyone help me in that? I have made lots of changes in ontouch event
   written above but fail.

   So please help me in that. I really appreciate it. Thank you 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- 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 

[android-developers] Re: No google orders results for SDK11

2011-04-24 Thread Zsolt Vasvari
The numbers haven't been updated for days.

On Apr 24, 3:28 pm, Droid rod...@gmail.com wrote:
 I have done several apps that target SDK11 alone (Xoom, Acer tablets)
 but I get zero downloads results in my orders pages.

 I am absolutely certain that there have been downloads but there are
 no results (over 5 popular apps).

 Have Google switched off downloads and analytics for SDK11?

-- 
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: Timezone Question

2011-04-24 Thread Jake Colman

Bob, et al,

Wow!  Great comments and replies.  Thanks!

The sunrise/sunset time is given in UTC based on lat/long.  As another
poster said, I do have that part down pat.  My only concern is with how
to display the time for the correct timezone.

My user has manually set his timezone because of a problem with Google
calendar.  He never wants the phone to know that it might have changed
timezones.  The phone still displays the correct time for the local
timezone.  His request is that since the phone knows the correct time,
why is my app not displaying the correct time for sunset.

I think I will go with one of the other poster's comments.  Since the
phone is being told its timezone, the app will do what its told.  If it
becomes important, I can always add a preference to allow a user to
override the timezone setting for the app.

Thanks for all the help!

...Jake


 BK == Bob Kerns r...@acm.org writes:

   BK While one hopes he does, it's not always a good assumption.  But
   BK that aspect wasn't the intended focus of my remarks.

   BK The point is -- the timezone SHOULD have absolutely ZERO impact
   BK on the actual calculated times.

   BK There are really only three ways to get an error here that I can
   BK see. (Chime in if you can come up with more!)

   BK * Using the wrong location.
   BK * Doing the wrong calculation.
   BK * Displaying with the wrong timezone (including DST errors, but that
   BK shouldn't be possible as a program error that I can see).

   BK A fourth possibility is a confused user; I'm not sure how to
   BK break down the possibilities there -- though using a TZ with
   BK different DST characteristics might be included.

   BK But I think the first step in sorting out the problem is to
   BK identify which problem you have, and that was why I was covering
   BK the territory. I hope the OP understands that I don't know any
   BK details of his knowledge or app, and can disregard any aspect of
   BK my message he's confident he's adequately eliminated!

   BK On Sat, Apr 23, 2011 at 8:40 AM, String 
sterling.ud...@googlemail.comwrote:

No offense, Bob (and I do mean that, I value your posts on this forum), 
but
I think we can safely assume that the OP knows how to calculate times of
sunrise and sunset. He's already showing that in his app, from the sound 
of
things, and is probably doing OK with that aspect.

The issue at hand is how (and maybe whether) to work around a user having
set their phone to a different zone than the one they're actually
in. Nobody
says this is affecting the absolute (UTC) time of sunrise/sunset in the
calculations, it's purely about display.

String


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


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

-- 
Jake Colman -- Android Tinkerer

-- 
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] Widget-specific Preferences

2011-04-24 Thread Jake Colman

I am looking to implemented widget-specific preferences in my app.  I
have reviewed numerous blogs and posts, including Kostya's, and am
familiar with the overall approach of using the widget ID as a suffix to
the preference key.

I currently use a Preference Activity and a preference XML file to
manage my preferences.  Since a Preference Activity handles edits on its
own, is there still a way to use it if I need to change the key name at
runtime to have a widget id?  I am pretty sure I can get the widget from
the intent since it is launched as a configuration activity but can I
tap in and use it?

-- 
Jake Colman -- Android Tinkerer

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


Re: [android-developers] Wallpaper size

2011-04-24 Thread Dianne Hackborn
Define don't work.

On Sun, Apr 24, 2011 at 1:12 AM, Simon Platten simonaplat...@googlemail.com
 wrote:

 On Android 1.6 my wallpaper applications resize the wallpapers correctly,
 however on Android 2.1 the resizing doesn't work, its the same on the
 emulator.

 I've tried using both the Matrix and Bitmap.createScaledBitmap both do
 exactly the same and work find on 1.6.  Can anyone explain what is happing
 and why these routines don't work on Android 2.1?

 I start off by getting the device screen size using:

 Display display = app.getWindowManager().
 getDefaultDisplay();
 m_intScrWidth = display.getWidth();
 m_intScrHeight = display.getHeight();

 I load the image from a resource with:

 m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
 m_intImgWidth  = m_bmpImage.getWidth();
 m_intImgHeight = m_bmpImage.getHeight();
 m_fltSFbyHeight = (float)m_intScrHeight / (float)m_intImgWidth;

 Then to scale the image:

 m_intFinalWidth  = (int)((float)m_intImgWidth * m_fltSFbyHeight);
 m_intFinalHeight = (int)((float)m_intImgHeight * m_fltSFbyHeight);

 Thank you,
 Simon

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




-- 
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, and so won't reply to such e-mails.  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

Re: [android-developers] Widget-specific Preferences

2011-04-24 Thread Kostya Vasilyev

Jake,

It's possible to make your subclass of PreferenceActivity use a specific 
preference file by putting something like this inside its onCreate:


PreferenceManager prefManager = getPreferenceManager();
prefManager.setSharedPreferencesName(widget_pref_ + 
String.valueOf(widgetId));


This seems somewhat inefficient though, because each widget will get its 
own preference storage file.


To use a single preference file where each widget gets its own set of 
keys (dependent on a particular widget id), you could try using 
Preference.setKey:


for preference : all Preferences in the screen {
String keyOriginal = preference.getKey();
String keyWithWidgetId = keyOriginal + String.valueOf(widgetId);
preference.setKey(keyWithWidgetId);
}

Hope this helps.

-- Kostya

24.04.2011 17:28, Jake Colman пишет:

I currently use a Preference Activity and a preference XML file to
manage my preferences.  Since a Preference Activity handles edits on its
own, is there still a way to use it if I need to change the key name at
runtime to have a widget id?  I am pretty sure I can get the widget from
the intent since it is launched as a configuration activity but can I
tap in and use it?



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 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


Re: [android-developers] Click event on Edit-Text's Right Drawable.

2011-04-24 Thread Hyvi
I wrote something wrong int AndroidManifest.xml  ,so that the
exception occured .

2011/4/24 Hyvi tanhaiwei0...@gmail.com:
 I want to test .. but failure ..
 Java code

 public void onCreate(Bundle savedInstanceState)
      {
           super.onCreate(savedInstanceState);
          setContentView(new CustomEditTextActivity(this));
       }

 error ouput :
 E/AndroidRuntime(  296): java.lang.RuntimeException: Unable to instantiate
 activity
 ComponentInfo{com.gliese.android/com.gliese.android.CustomEditTextActivity}:
 java.lang.InstantiationException: com.gliese.android.CustomEditTextActivity
 E/AndroidRuntime(  296): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
 E/AndroidRuntime(  296): at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
 E/AndroidRuntime(  296): at
 android.app.ActivityThread.access$2300(ActivityThread.java:125)
 E/AndroidRuntime(  296): at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
 E/AndroidRuntime(  296): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 E/AndroidRuntime(  296): at android.os.Looper.loop(Looper.java:123)
 E/AndroidRuntime(  296): at
 android.app.ActivityThread.main(ActivityThread.java:4627)
 E/AndroidRuntime(  296): at java.lang.reflect.Method.invokeNative(Native
 Method)
 E/AndroidRuntime(  296): at java.lang.reflect.Method.invoke(Method.java:521)
 E/AndroidRuntime(  296): at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 E/AndroidRuntime(  296): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 E/AndroidRuntime(  296): at dalvik.system.NativeStart.main(Native Method)
 E/AndroidRuntime(  296): Caused by: java.lang.InstantiationException:
 com.gliese.android.CustomEditTextActivity
 E/AndroidRuntime(  296): at java.lang.Class.newInstanceImpl(Native Method)
 E/AndroidRuntime(  296): at java.lang.Class.newInstance(Class.java:1429)
 E/AndroidRuntime(  296): at
 android.app.Instrumentation.newActivity(Instrumentation.java:1021)
 E/AndroidRuntime(  296): at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
 E/AndroidRuntime(  296): ... 11 more
  Caused by: java.lang.InstantiationException:
 com.gliese.android.CustomEditTextActivity ..
 can  anyone help me ?
 2011/4/23 Sunil Lakhiyani slakhiyaniandr...@gmail.com

 Hello Developers,
 I have one Edit Text with right drawable.
 The xml code is
 TextView android:id=@+id/trip_txt_to
 android:layout_width=wrap_content android:layout_height=wrap_content
 android:text=@string/addname android:layout_alignParentLeft=true
 android:textStyle=bold android:textColor=@color/black
 android:typeface=normal android:padding=10dp
 android:layout_below=@+id/lineview1 /
 test.ui.CustomEditTextActivity
 android:id=@+id/nameofpersonr android:layout_height=wrap_content
 android:hint=@string/hint
 android:layout_toRightOf=@+id/name android:textColor=@color/black
 android:typeface=normal
 android:layout_below=@+id/lineview1
 android:drawableRight=@drawable/icon
                                 android:layout_width=180dp
 /test.ui.CustomEditTextActivity
 ImageView android:id=@+id/clearnameimage
 android:layout_alignParentRight=true android:layout_width=wrap_content
 android:layout_height=wrap_content android:scaleType=fitXY
 android:layout_below=@+id/lineview1
 android:src=@drawable/deleteicon android:padding=5dp/

 and CustomEditTextActivity.java
 public class CustomEditTextActivity extends EditText {
 private Drawable rightSideDrawable;
 private Rect rectangleBounds;
 public CustomEditTextActivity(Context context, AttributeSet attributeSet,
 int defStyle) {
 super(context, attributeSet, defStyle);
 }
 public CustomEditTextActivity(Context context, AttributeSet attributeSet)
 {
 super(context, attributeSet);
 }
 public CustomEditTextActivity(Context context) {
 super(context);
 }
 @Override
 public void setCompoundDrawables(Drawable left, Drawable top,
 Drawable right, Drawable bottom) {
 if (right != null) {
 rightSideDrawable = right;
 }
 super.setCompoundDrawables(left, top, right, bottom);
 }
 @Override
 protected void finalize() throws Throwable {
 rightSideDrawable = null;
 rectangleBounds = null;
 super.finalize();
 }
 public Rect getRectBound() {
 return rectangleBounds;
 }
 public Drawable getRightDrawable() {
 return rightSideDrawable;
 }
          // on touch event code i got from some site..
 @Override
     public boolean onTouchEvent(MotionEvent event)
     {
         if(event.getAction() == MotionEvent.ACTION_UP 
 rightSideDrawable!=null)
         {
          rectangleBounds = rightSideDrawable.getBounds();
             final int x = (int)event.getX();
             final int y = (int)event.getY();

             if(x=(this.getRight()-rectangleBounds.width()) 
 x=(this.getRight()-this.getPaddingRight())
                      y=this.getPaddingTop() 
 y=(this.getHeight()-this.getPaddingBottom()))
             {
                 this.setText();
                 

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread David Williams

Thanks, that worked.
Another question.  I need to get into the command line of my emulator 
and edit my /etc/hosts file for testing.  I was hoping that Putty would 
give me command line access but that doesn't seem to be the case.


Would appreciate any help.


David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie 
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum 
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ 
http://www.dtw-consulting.com/GolfCaddie/faq.html by DTW-Consulting, Inc.




On 4/23/2011 5:41 PM, Mark Murphy wrote:
Make sure you are using telnet, not SSH or another protocol. Putty 
works fine for me, with telnet on 5554, on Vista.


On Sat, Apr 23, 2011 at 5:49 PM, David Williams 
dwilli...@dtw-consulting.com mailto:dwilli...@dtw-consulting.com 
wrote:


All,

Is there a way to connect to the Android emulator (I am on Windows
7) with Putty?  I did a search and tried connecting to ports 5554
and  on the localhost, but that didn't work.
-- 



David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ
http://www.dtw-consulting.com/GolfCaddie/faq.html by
DTW-Consulting, Inc.


-- 
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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6 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 


--
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=eninline: GClogo.png

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Mark Murphy
Use adb shell from the command line of your Windows PC.

On Sun, Apr 24, 2011 at 10:34 AM, David Williams 
dwilli...@dtw-consulting.com wrote:

  Thanks, that worked.
 Another question.  I need to get into the command line of my emulator and
 edit my /etc/hosts file for testing.  I was hoping that Putty would give me
 command line access but that doesn't seem to be the case.

 Would appreciate any help.
  --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.



 On 4/23/2011 5:41 PM, Mark Murphy wrote:

 Make sure you are using telnet, not SSH or another protocol. Putty works
 fine for me, with telnet on 5554, on Vista.

 On Sat, Apr 23, 2011 at 5:49 PM, David Williams 
 dwilli...@dtw-consulting.com wrote:

  All,

 Is there a way to connect to the Android emulator (I am on Windows 7) with
 Putty?  I did a search and tried connecting to ports 5554 and  on the
 localhost, but that didn't work.
  --
 --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.


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




 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.6 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

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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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

2011-04-24 Thread Dalvin
Hi

I am trying to read a simple text file in my sample Android Application. I 
am using the below written code for reading the simple text file.

1. InputStream inputStream = openFileInput(test.txt);
2. InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
3. BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

My questions is :
Where should I place this test.txt file in my project. I have tried 
putting the file under res/raw and asset folder but I get the exception 
FileNotFound when first live of the code written above gets executed.

Thanks
Dalvinder Singh

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

Re: [android-developers] OpenFileInput

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 11:17 AM, Dalvin singh.dal...@gmail.com wrote:
 I am trying to read a simple text file in my sample Android Application. I
 am using the below written code for reading the simple text file.
 1. InputStream inputStream = openFileInput(test.txt);
 2. InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
 3. BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
 My questions is :
 Where should I place this test.txt file in my project.

It does not go in your project.

 I have tried
 putting the file under res/raw and asset folder but I get the exception
 FileNotFound when first live of the code written above gets executed.

Of course.

If you want to read a raw resource, use getResources().openRawResource().

If you want to read an asset, use getResources().getAssets().open().

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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


Re: [android-developers] Click event on Edit-Text's Right Drawable.

2011-04-24 Thread Hyvi
I Use the follow code . and OK .

 Log.d(TAG,this.getPaddingRight():  + this.getPaddingRight());
 Log.d(TAG,this.getPaddingTop(): +this.getPaddingTop());
 Log.d(TAG,this.getHeight():  + this.getHeight());
 Log.d(TAG,this.getPaddingBottom():  + this.getPaddingBottom());


2011/4/23 Sunil Lakhiyani slakhiyaniandr...@gmail.com

 Hello Developers,

 I have one Edit Text with right drawable.
 The xml code is

 TextView android:id=@+id/trip_txt_to
 android:layout_width=wrap_content android:layout_height=wrap_content
  android:text=@string/addname android:layout_alignParentLeft=true
 android:textStyle=bold android:textColor=@color/black
  android:typeface=normal android:padding=10dp
 android:layout_below=@+id/lineview1 /

 test.ui.CustomEditTextActivity
 android:id=@+id/nameofpersonr android:layout_height=wrap_content
  android:hint=@string/hint
 android:layout_toRightOf=@+id/name android:textColor=@color/black
  android:typeface=normal
 android:layout_below=@+id/lineview1
 android:drawableRight=@drawable/icon
 android:layout_width=180dp
 /test.ui.CustomEditTextActivity

 ImageView android:id=@+id/clearnameimage
  android:layout_alignParentRight=true
 android:layout_width=wrap_content
 android:layout_height=wrap_content android:scaleType=fitXY
  android:layout_below=@+id/lineview1
 android:src=@drawable/deleteicon android:padding=5dp/


 and CustomEditTextActivity.java

 public class CustomEditTextActivity extends EditText {
 private Drawable rightSideDrawable;
  private Rect rectangleBounds;

 public CustomEditTextActivity(Context context, AttributeSet attributeSet,
  int defStyle) {

 super(context, attributeSet, defStyle);
  }

 public CustomEditTextActivity(Context context, AttributeSet attributeSet) {
  super(context, attributeSet);
 }

 public CustomEditTextActivity(Context context) {
  super(context);
 }

 @Override
  public void setCompoundDrawables(Drawable left, Drawable top,
 Drawable right, Drawable bottom) {
  if (right != null) {
 rightSideDrawable = right;
  }
 super.setCompoundDrawables(left, top, right, bottom);
 }

 @Override
 protected void finalize() throws Throwable {
 rightSideDrawable = null;
  rectangleBounds = null;
 super.finalize();
 }

 public Rect getRectBound() {
 return rectangleBounds;
 }

 public Drawable getRightDrawable() {
 return rightSideDrawable;
  }
   // on touch event code i got from some site..
 @Override
 public boolean onTouchEvent(MotionEvent event)
 {

 if(event.getAction() == MotionEvent.ACTION_UP 
 rightSideDrawable!=null)
 {
  rectangleBounds = rightSideDrawable.getBounds();
 final int x = (int)event.getX();
 final int y = (int)event.getY();

 if(x=(this.getRight()-rectangleBounds.width()) 
 x=(this.getRight()-this.getPaddingRight())
  y=this.getPaddingTop() 
 y=(this.getHeight()-this.getPaddingBottom()))
 {
 this.setText();
 event.setAction(MotionEvent.ACTION_CANCEL);//use this to
 prevent the keyboard from coming up
 }
 }
 return super.onTouchEvent(event);
 }

 }

 Now problem is,

 when i open the activity, it shows me keyboard and i can right in edit
 text, but as soon as i touch to edit text it launches another activity, i
 called it InfoActivity.java. But InfoActivity.java is supposed to be
 launched if I click on drawable not on edit text.
 Can you please help me to get click event or touch event on right hand side
 drawable, instead of edit text? or is there any other alternative way?
 Also, because of this i can not use this line for keyboard..


 this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);


 Can anyone help me in that? I have made lots of changes in ontouch event
 written above but fail.

 So please help me in that. I really appreciate it. Thank you 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




-- 
- Protect your dream ...

-- 
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: Widget-specific Preferences

2011-04-24 Thread Jake Colman

Kostya,

I like your second suggestion.

So in my Preference Activity's onCreate() I should get every preference by
original key name and then reset the key name to include the widget.
That means I'll have a full set of non-unique preference keys without
any data but that should not really be an issue.

According to the docs it does not look like there is a method to iterate
through all preferences so, instead, I'll have to get every preference
by specific key name and manually change each one.  Have I missed a more
direct way of changing all the keys?

If I use an onClickListener() and on SharedPreferenceChangeListener() to
detect specific preference clicks or changes to a preference, I can
parse out the widget ID from the key so that I know which specific
widget has been effected.  I can then make sure that I update just that
specific widget accordingly.  Can you think of a better way to do that?

To facilitate parsing out the widget id, I have already externalized all
my key names as string resources so that I can edit the string to
include a :.  This way I can parse out the text that follows the :
and get the widget id.  Did you do something similar or did you not have
the need to know which widgetid has had its preference changed?

...Jake


 KV == Kostya Vasilyev kmans...@gmail.com writes:

   KV Jake,

   KV It's possible to make your subclass of PreferenceActivity use a
   KV specific preference file by putting something like this inside
   KV its onCreate:

   KV PreferenceManager prefManager = getPreferenceManager();
   KV prefManager.setSharedPreferencesName(widget_pref_ +
   KV String.valueOf(widgetId));

   KV This seems somewhat inefficient though, because each widget will
   KV get its own preference storage file.

   KV To use a single preference file where each widget gets its own
   KV set of keys (dependent on a particular widget id), you could try
   KV using Preference.setKey:

   KV for preference : all Preferences in the screen {
   KV String keyOriginal = preference.getKey();
   KV String keyWithWidgetId = keyOriginal + String.valueOf(widgetId);
   KV preference.setKey(keyWithWidgetId);
   KV }

   KV Hope this helps.

   KV -- Kostya

   KV 24.04.2011 17:28, Jake Colman пишет:

I currently use a Preference Activity and a preference XML file to
manage my preferences.  Since a Preference Activity handles edits
on its own, is there still a way to use it if I need to change the
key name at runtime to have a widget id?  I am pretty sure I can
get the widget from the intent since it is launched as a
configuration activity but can I tap in and use it?

   KV -- 
   KV Kostya Vasilyev -- http://kmansoft.wordpress.com

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

-- 
Jake Colman -- Android Tinkerer

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


Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread David Williams

Thanks, will look into that.  Is this available from Eclipse too?


David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie 
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum 
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ 
http://www.dtw-consulting.com/GolfCaddie/faq.html by DTW-Consulting, Inc.




On 4/24/2011 9:55 AM, Mark Murphy wrote:

Use adb shell from the command line of your Windows PC.

On Sun, Apr 24, 2011 at 10:34 AM, David Williams 
dwilli...@dtw-consulting.com mailto:dwilli...@dtw-consulting.com 
wrote:


Thanks, that worked.
Another question.  I need to get into the command line of my
emulator and edit my /etc/hosts file for testing.  I was hoping
that Putty would give me command line access but that doesn't seem
to be the case.

Would appreciate any help.


David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ
http://www.dtw-consulting.com/GolfCaddie/faq.html by
DTW-Consulting, Inc.



On 4/23/2011 5:41 PM, Mark Murphy wrote:

Make sure you are using telnet, not SSH or another protocol.
Putty works fine for me, with telnet on 5554, on Vista.

On Sat, Apr 23, 2011 at 5:49 PM, David Williams
dwilli...@dtw-consulting.com
mailto:dwilli...@dtw-consulting.com wrote:

All,

Is there a way to connect to the Android emulator (I am on
Windows 7) with Putty?  I did a search and tried connecting
to ports 5554 and  on the localhost, but that didn't work.
-- 



David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie
Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
Caddie FAQ
http://www.dtw-consulting.com/GolfCaddie/faq.html by
DTW-Consulting, Inc.


-- 
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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




-- 
Mark Murphy (a Commons Guy)

http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.6
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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en 
-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books
--
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 


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Mark Murphy
Not that I am aware of.

On Sun, Apr 24, 2011 at 12:14 PM, David Williams 
dwilli...@dtw-consulting.com wrote:

  Thanks, will look into that.  Is this available from Eclipse too?

  --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.



 On 4/24/2011 9:55 AM, Mark Murphy wrote:

 Use adb shell from the command line of your Windows PC.

 On Sun, Apr 24, 2011 at 10:34 AM, David Williams 
 dwilli...@dtw-consulting.com wrote:

  Thanks, that worked.
 Another question.  I need to get into the command line of my emulator and
 edit my /etc/hosts file for testing.  I was hoping that Putty would give me
 command line access but that doesn't seem to be the case.

 Would appreciate any help.
   --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.



   On 4/23/2011 5:41 PM, Mark Murphy wrote:

 Make sure you are using telnet, not SSH or another protocol. Putty works
 fine for me, with telnet on 5554, on Vista.

 On Sat, Apr 23, 2011 at 5:49 PM, David Williams 
 dwilli...@dtw-consulting.com wrote:

  All,

 Is there a way to connect to the Android emulator (I am on Windows 7)
 with Putty?  I did a search and tried connecting to ports 5554 and  on
 the localhost, but that didn't work.
  --
 --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.


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




 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.6 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

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




 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android 3.0 Programming Books: http://commonsware.com/books
 --
 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

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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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

Re: [android-developers] Re: java

2011-04-24 Thread Filip Havlicek
Thought that's what we want - exercise the basics, get used to Java syntax
etc :) The database example is usually done using a custom CSV database file
- to exercise disk operations in Java. Both of these examples are also
easily extendable with more options to  practice the required parts of Java.

2011/4/23 DanH danhi...@ieee.org

 Yes, something to become familiar with SQL would be good, though the
 Android interfaces differ significantly from vanilla Java's.  And any
 sort of puzzle solver would exercise the basics.

 On Apr 23, 8:10 am, Filip Havlicek havlicek.fi...@gmail.com wrote:
  What we do with students is implementing a common command-line database
 (of
  employees, cars etc) or a sudoku solver/generator. Practices most of the
  basic Java stuff, not bad for a beginner. And I'm pretty sure there are a
  lot of other options (possibly more interesting), although these are easy
 to
  comprehend as what is the input, output, expected behaviour etc and one
 can
  focus on the Java itself while coding it.
 
  Best regards,
  Filip Havlicek
 
  2011/4/23 DanH danhi...@ieee.org
 
   I'd suggest you get a decent book on Java and play around with it a
   bit before tackling Android.  Shouldn't take a lot with your
   background, but a few days doing that would be time well spent.
 
   (Trying to think of an application to implement, but nothing coming to
   mind at present.  Maybe someone else has an idea for a command line
   Java app/toy?)
 
   On Apr 22, 10:09 am, hoss7 hoss...@gmail.com wrote:
hi
i want start develop android app
can i develop android app if i dont know java?
 
   --
   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

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


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

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Moose
If I ever need to edit a file, I use the terminal commands

$ adb pull /path/to/file .
*edit the file as you need to to*
$ adb push file /path/to/file

I know there is also a way you can edit a file by using 'cat' in the android 
shell, but I prefer to edit a dynamic file and replace it.

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

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread David Williams

Thanks,

That is what I tried, but I wanted to edit the /etc/hosts file and when 
I tried the push I was told that the file system was read only, so I 
couldn't push the file.



David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie 
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum 
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ 
http://www.dtw-consulting.com/GolfCaddie/faq.html by DTW-Consulting, Inc.




On 4/24/2011 12:08 PM, Moose wrote:

If I ever need to edit a file, I use the terminal commands

$ adb pull /path/to/file .
*edit the file as you need to to*
$ adb push file /path/to/file

I know there is also a way you can edit a file by using 'cat' in the 
android shell, but I prefer to edit a dynamic file and replace it.

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


--
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=eninline: GClogo.png

Re: [android-developers] OpenFileInput

2011-04-24 Thread Dalvinder Singh
Thanks Mark

I have tried the approach mentioned by you and it worked.

Thanks
Dalvin

On Sun, Apr 24, 2011 at 8:53 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Sun, Apr 24, 2011 at 11:17 AM, Dalvin singh.dal...@gmail.com wrote:
  I am trying to read a simple text file in my sample Android Application.
 I
  am using the below written code for reading the simple text file.
  1. InputStream inputStream = openFileInput(test.txt);
  2. InputStreamReader inputStreamReader = new
 InputStreamReader(inputStream);
  3. BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
  My questions is :
  Where should I place this test.txt file in my project.

 It does not go in your project.

  I have tried
  putting the file under res/raw and asset folder but I get the
 exception
  FileNotFound when first live of the code written above gets executed.

 Of course.

 If you want to read a raw resource, use getResources().openRawResource().

 If you want to read an asset, use getResources().getAssets().open().

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android 3.0 Programming Books: http://commonsware.com/books

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


-- 
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: Wallpaper size

2011-04-24 Thread Simon Platten
When using the code on Android 1.6 platforms, the bitmaps are re-sized as
aspected, however when used on Android 2.1 its as if the function to rescale
has no effect what so ever, the wallpapers always come out the wrong size.


On Sun, Apr 24, 2011 at 9:12 AM, Simon Platten simonaplat...@googlemail.com
 wrote:

 On Android 1.6 my wallpaper applications resize the wallpapers correctly,
 however on Android 2.1 the resizing doesn't work, its the same on the
 emulator.

 I've tried using both the Matrix and Bitmap.createScaledBitmap both do
 exactly the same and work find on 1.6.  Can anyone explain what is happing
 and why these routines don't work on Android 2.1?

 I start off by getting the device screen size using:

 Display display = app.getWindowManager().
 getDefaultDisplay();
 m_intScrWidth = display.getWidth();
 m_intScrHeight = display.getHeight();

 I load the image from a resource with:

 m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
 m_intImgWidth  = m_bmpImage.getWidth();
 m_intImgHeight = m_bmpImage.getHeight();
 m_fltSFbyHeight = (float)m_intScrHeight / (float)m_intImgWidth;

 Then to scale the image:

 m_intFinalWidth  = (int)((float)m_intImgWidth * m_fltSFbyHeight);
 m_intFinalHeight = (int)((float)m_intImgHeight * m_fltSFbyHeight);

 Thank you,
 Simon


-- 
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: Wallpaper size

2011-04-24 Thread Simon Platten
Sorry, I should have included the code to resize, once I calculate the 
new width and height I call:


return Bitmap.createScaledBitmap(m_bmpImage,
m_intFinalWidth,
m_intFinalHeight,
false);


On 24/04/2011 6:34 PM, Simon Platten wrote:
When using the code on Android 1.6 platforms, the bitmaps are re-sized 
as aspected, however when used on Android 2.1 its as if the function 
to rescale has no effect what so ever, the wallpapers always come out 
the wrong size.



On Sun, Apr 24, 2011 at 9:12 AM, Simon Platten 
simonaplat...@googlemail.com mailto:simonaplat...@googlemail.com 
wrote:


On Android 1.6 my wallpaper applications resize the wallpapers
correctly, however on Android 2.1 the resizing doesn't work, its
the same on the emulator.

I've tried using both the Matrix and Bitmap.createScaledBitmap
both do exactly the same and work find on 1.6.  Can anyone explain
what is happing and why these routines don't work on Android 2.1?

I start off by getting the device screen size using:

Display display = app.getWindowManager().
getDefaultDisplay();
m_intScrWidth = display.getWidth();
m_intScrHeight = display.getHeight();

I load the image from a resource with:

m_bmpImage = BitmapFactory.decodeResource( m_res,
intResId );
m_intImgWidth  = m_bmpImage.getWidth();
m_intImgHeight = m_bmpImage.getHeight();
m_fltSFbyHeight = (float)m_intScrHeight /
(float)m_intImgWidth;

Then to scale the image:

m_intFinalWidth  = (int)((float)m_intImgWidth *
m_fltSFbyHeight);
m_intFinalHeight = (int)((float)m_intImgHeight *
m_fltSFbyHeight);

Thank you,
Simon




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

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Mark Murphy
Well, you can't edit the file, then.

On Sun, Apr 24, 2011 at 1:14 PM, David Williams 
dwilli...@dtw-consulting.com wrote:

  Thanks,

 That is what I tried, but I wanted to edit the /etc/hosts file and when I
 tried the push I was told that the file system was read only, so I couldn't
 push the file.
  --

 David Williams
 Check out our WebOS mobile phone app for the Palm Pre and Pixi:
  http://www.dtw-consulting.com/GolfCaddie   Golf 
 Caddiehttp://www.dtw-consulting.com/GolfCaddie| Golf
 Caddie Forum http://www.dtw-consulting.com/GolfCaddie/forum | Golf
 Caddie FAQ http://www.dtw-consulting.com/GolfCaddie/faq.html by
 DTW-Consulting, Inc.



 On 4/24/2011 12:08 PM, Moose wrote:

 If I ever need to edit a file, I use the terminal commands

 $ adb pull /path/to/file .
 *edit the file as you need to to*
 $ adb push file /path/to/file

  I know there is also a way you can edit a file by using 'cat' in the
 android shell, but I prefer to edit a dynamic file and replace it.
  --
 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

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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

-- 
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: Wallpaper size

2011-04-24 Thread Simon Platten
I can get the size of the wallpaper from the wallpaper manager:

m_context = app.getApplicationContext();
WallpaperManager wpMngr = WallpaperManager.getInstance(
m_context );
m_intWPheight = wpMngr.getDesiredMinimumHeight();
m_intWPwidth  = wpMngr.getDesiredMinimumWidth();

I can then get the size of the display area:

Display display = app.getWindowManager().getDefaultDisplay();
m_intScrWidth = display.getWidth();
m_intScrHeight = display.getHeight();

I have my image that I want to rescale:

m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
m_intImgWidth  = m_bmpImage.getWidth();
m_intImgHeight = m_bmpImage.getHeight();

Scaling from the Image height to the display height:

m_fltSFbyHeight = (float)m_intScrHeight / (float)m_intImgHeight;

What I want to do is create a black bitmap that is the same size as the
wallpaper ( intWPwidth, m_intWPheight ), then copy/blit into this bitmap the
bitmap to use as the wallpaper re-scaling it to fit if required, so I end up
with a bitmap image the same size as the wallpaper with the image centered
and scaled in the middle of it.

Thank you.


On Sun, Apr 24, 2011 at 6:39 PM, Simon Platten simonaplat...@googlemail.com
 wrote:

  Sorry, I should have included the code to resize, once I calculate the new
 width and height I call:

 return Bitmap.createScaledBitmap(m_bmpImage,
 m_intFinalWidth,
 m_intFinalHeight,
 false);



 On 24/04/2011 6:34 PM, Simon Platten wrote:

 When using the code on Android 1.6 platforms, the bitmaps are re-sized as
 aspected, however when used on Android 2.1 its as if the function to rescale
 has no effect what so ever, the wallpapers always come out the wrong size.


 On Sun, Apr 24, 2011 at 9:12 AM, Simon Platten 
 simonaplat...@googlemail.com wrote:

 On Android 1.6 my wallpaper applications resize the wallpapers correctly,
 however on Android 2.1 the resizing doesn't work, its the same on the
 emulator.

 I've tried using both the Matrix and Bitmap.createScaledBitmap both do
 exactly the same and work find on 1.6.  Can anyone explain what is happing
 and why these routines don't work on Android 2.1?

 I start off by getting the device screen size using:

 Display display = app.getWindowManager().
 getDefaultDisplay();
 m_intScrWidth = display.getWidth();
 m_intScrHeight = display.getHeight();

 I load the image from a resource with:

 m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
 m_intImgWidth  = m_bmpImage.getWidth();
 m_intImgHeight = m_bmpImage.getHeight();
 m_fltSFbyHeight = (float)m_intScrHeight /
 (float)m_intImgWidth;

 Then to scale the image:

 m_intFinalWidth  = (int)((float)m_intImgWidth * m_fltSFbyHeight);
 m_intFinalHeight = (int)((float)m_intImgHeight * m_fltSFbyHeight);

 Thank you,
 Simon





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

Re: [android-developers] Re: Widget-specific Preferences

2011-04-24 Thread Kostya Vasilyev

24.04.2011 19:35, Jake Colman пишет:

Kostya,

I like your second suggestion.

So in my Preference Activity's onCreate() I should get every preference by
original key name and then reset the key name to include the widget.


Basically, yes.


That means I'll have a full set of non-unique preference keys without
any data but that should not really be an issue.


Not necessarily - if you tweak all the keys inside onCreate, before any 
preference values are saved, I don't think you will have any orphaned value.



According to the docs it does not look like there is a method to iterate
through all preferences so, instead, I'll have to get every preference
by specific key name and manually change each one.  Have I missed a more
direct way of changing all the keys?


PreferenceGroup (which PreferenceScreen is a subclass of) has int 
getPreferenceCount() / getPreference(int index).



If I use an onClickListener() and on SharedPreferenceChangeListener() to
detect specific preference clicks or changes to a preference, I can
parse out the widget ID from the key so that I know which specific
widget has been effected.  I can then make sure that I update just that
specific widget accordingly.  Can you think of a better way to do that?


Umm... Sounds like you also want to present options for multiple widgets 
at the same time within a single preference activity?


If so, I would not use the activity as the event listener.

I'd create a class that encapsulates the complete set of preferences for 
one widget instance, serves as the event listener for the involved 
Preference objects, and knows its associated widget Id value. The 
activity would instantiate these objects as needed, one for each widget Id.


I'd also use onPreferenceChange rather that onSharedPreferenceChanged, 
because the former uses a Preference reference you can switch on, 
without parsing preference keys.


-- Kostya


To facilitate parsing out the widget id, I have already externalized all
my key names as string resources so that I can edit the string to
include a :.  This way I can parse out the text that follows the :
and get the widget id.  Did you do something similar or did you not have
the need to know which widgetid has had its preference changed?


My widgets are so simple, I don't use PreferenceActivity to configure 
them :)


-- Kostya


...Jake



KV == Kostya Vasilyevkmans...@gmail.com  writes:

KV  Jake,

KV  It's possible to make your subclass of PreferenceActivity use a
KV  specific preference file by putting something like this inside
KV  its onCreate:

KV  PreferenceManager prefManager = getPreferenceManager();
KV  prefManager.setSharedPreferencesName(widget_pref_ +
KV  String.valueOf(widgetId));

KV  This seems somewhat inefficient though, because each widget will
KV  get its own preference storage file.

KV  To use a single preference file where each widget gets its own
KV  set of keys (dependent on a particular widget id), you could try
KV  using Preference.setKey:

KV  for preference : all Preferences in the screen {
KV  String keyOriginal = preference.getKey();
KV  String keyWithWidgetId = keyOriginal + String.valueOf(widgetId);
KV  preference.setKey(keyWithWidgetId);
KV  }

KV  Hope this helps.

KV  -- Kostya

KV  24.04.2011 17:28, Jake Colman пишет:

  I currently use a Preference Activity and a preference XML file to
  manage my preferences.  Since a Preference Activity handles edits
  on its own, is there still a way to use it if I need to change the
  key name at runtime to have a widget id?  I am pretty sure I can
  get the widget from the intent since it is launched as a
  configuration activity but can I tap in and use it?

KV  -- 
KV  Kostya Vasilyev -- http://kmansoft.wordpress.com


KV  -- 
KV  You received this message because you are subscribed to the Google

KV  Groups Android Developers group.
KV  To post to this group, send email to 
android-developers@googlegroups.com
KV  To unsubscribe from this group, send email to
KV  android-developers+unsubscr...@googlegroups.com
KV  For more options, visit this group at
KV  http://groups.google.com/group/android-developers?hl=en




--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 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] image processing in android

2011-04-24 Thread kumar Gaurav
I wanna find correlation co-efficient of two images. i have images in
imageview.
do we have any component in android that let us acess image for
processing?
please help

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


[android-developers] Re: Integrating Android clients (Native Java and AIR) with Java and .NET backends

2011-04-24 Thread Tim
I have to agree that integration with back office systems using
various web services can be very difficult.  But in many cases using a
web service to connect to for an example a back office database is a
rather long winded approach, when the Android SDK includes full
database JDBC support.  In fact our rapid application developer tool
MobiForms (see www.mobiforms.com) supports JDBC connectivity to a
range of back office database and is ideal for database orientated
apps.  We have many customers connecting from Android straight back to
ERP and financial packages like SAP, Oracle Apps, Navision and
Dynamics.

On Apr 21, 10:03 pm, mcoderkat cokathl...@gmail.com wrote:
 Developers creating Android applications that connect to Java or .NET
 services can face significant integration challenges given the
 fragmentation of the Android OS. We have remoting and messaging APIs
 that will help ease your integration effort and would like to invite
 you to visit our blog and view the associated video. Some of the
 topics covered include:

 1) Android talking to both Java and .NET via RTMPT
 2) Android using pub/sub with JMS, NMS and ActiveMQ
 3) Android exchanging data with Adobe AIR/Flex clients
 4) How to use RTMP shared objects in Android apps
 5) How to use code generation to assist with building Android apps
 6) Cross platform communication between multiple client types and
 servers

 Here is the link to that article and 
 video:http://blog.themidnightcoders.com/index.php/2011/04/15/developing-and...

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


Re: [android-developers] Re: WebView and geolocation questions

2011-04-24 Thread Moose
I just tried using phonegap as a front for it, however I have exactly the 
same problem. The test website somehow works in the firefox browser (not the 
AOSP browser though). I know firefox uses some really low level interaction 
with the hardware - I wonder if that might be why /it/ works.

-- 
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] SimpleDateFormat Problem

2011-04-24 Thread Jake Colman

Per the docs, I should be able to get a time formatted as follows:

  7:33p

with a format string of

  h:mma

The result, however is

  7:33PM

Is this a documentation bug, a Jake bug, or is this not possible?

-- 
Jake Colman -- Android Tinkerer

-- 
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: Widget-specific Preferences

2011-04-24 Thread Jake Colman
 KV == Kostya Vasilyev kmans...@gmail.com writes:

   KV 24.04.2011 19:35, Jake Colman пишет:

If I use an onClickListener() and on
SharedPreferenceChangeListener() to detect specific preference
clicks or changes to a preference, I can parse out the widget ID
from the key so that I know which specific widget has been
effected.  I can then make sure that I update just that specific
widget accordingly.  Can you think of a better way to do that?

   KV Umm... Sounds like you also want to present options for multiple
   KV widgets at the same time within a single preference activity?

   KV If so, I would not use the activity as the event listener.

   KV I'd create a class that encapsulates the complete set of
   KV preferences for one widget instance, serves as the event listener
   KV for the involved Preference objects, and knows its associated
   KV widget Id value. The activity would instantiate these objects as
   KV needed, one for each widget Id.

   KV I'd also use onPreferenceChange rather that
   KV onSharedPreferenceChanged, because the former uses a Preference
   KV reference you can switch on, without parsing preference keys.

Actually, no.  :-)

I want to, for example, allow instance #1 to have a different label than
instance #2.  If I continue to use my single Preference Activity which
has one listener for all widgets, it will need to know which widget's
key has been changed so that it can update that instance.  Hm.
Unless I just update all instances all the time when any one instance's
preference is changed...


-- 
Jake Colman -- Android Tinkerer

-- 
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: image processing in android

2011-04-24 Thread Streets Of Boston
The classes Bitmap and BitmapFactory.

-- 
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: SimpleDateFormat Problem

2011-04-24 Thread Streets Of Boston
Per the docs, I should be able to get a time formatted as follows: Which 
docs says that 'p' and 'a' are valid values?
 
AM and PM are the official en-US locale strings for before noon and after 
noon.
The 'p' and 'a' are not official locale strings for 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

Re: [android-developers] Re: SimpleDateFormat Problem

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 5:28 PM, Streets Of Boston
flyingdutc...@gmail.com wrote:
 Per the docs, I should be able to get a time formatted as follows: Which
 docs says that 'p' and 'a' are valid values?

 AM and PM are the official en-US locale strings for before noon and after
 noon.
 The 'p' and 'a' are not official locale strings for this.

Specifically, the docs state:

Note that the count [of characters in a pattern] does not specify the
exact width of the field. Just because you have a single a does not
mean you get a one-character AM/PM designator.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

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


Re: [android-developers] Re: Widget-specific Preferences

2011-04-24 Thread Kostya Vasilyev
Well, in that case you already know the widget id for a particular instance
of your configuration activity - it's passed in as an intent extra.
 25.04.2011 1:21 пользователь Jake Colman col...@ppllc.com написал:
 KV == Kostya Vasilyev kmans...@gmail.com writes:

 KV 24.04.2011 19:35, Jake Colman пишет:

  If I use an onClickListener() and on
  SharedPreferenceChangeListener() to detect specific preference
  clicks or changes to a preference, I can parse out the widget ID
  from the key so that I know which specific widget has been
  effected. I can then make sure that I update just that specific
  widget accordingly. Can you think of a better way to do that?

 KV Umm... Sounds like you also want to present options for multiple
 KV widgets at the same time within a single preference activity?

 KV If so, I would not use the activity as the event listener.

 KV I'd create a class that encapsulates the complete set of
 KV preferences for one widget instance, serves as the event listener
 KV for the involved Preference objects, and knows its associated
 KV widget Id value. The activity would instantiate these objects as
 KV needed, one for each widget Id.

 KV I'd also use onPreferenceChange rather that
 KV onSharedPreferenceChanged, because the former uses a Preference
 KV reference you can switch on, without parsing preference keys.

 Actually, no. :-)

 I want to, for example, allow instance #1 to have a different label than
 instance #2. If I continue to use my single Preference Activity which
 has one listener for all widgets, it will need to know which widget's
 key has been changed so that it can update that instance. Hm.
 Unless I just update all instances all the time when any one instance's
 preference is changed...


 --
 Jake Colman -- Android Tinkerer

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

-- 
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] Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
I want to intercept an EditText long-press and do something with it
other than present a contextual menu.  Obviously, I cannot simply
disable the GestureDetector's long press detection because I do in
fact want to use the long press.  By the time onCreateContextMenu() is
called, it seems to be too late to prevent the contextual menu from
occurring.  Not calling super.onCreateContextMenu for example doesn't
prevent it, nor does anything else I have tried...and
onCreateContextMenu() is called before onLongPress(), so the answer to
my question can't be some behavior in onLongPress().  Should I be
doing something in dispatchTouchEvent(), onDown(), or showPress() to
accomplish this goal?  Those seem to be the only methods that are
called before onCreateContextMenu().

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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
Sorry, quick followup.  The EditText in question is a subclass of my
own creation, not just a generic EditText.  It already extends
EditText and implements TextWatcher, OnKeyListener, OnGestureListener,
and GestureDetector.OnDoubleTapListener for various uses.

Thanks again.

-- 
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] 1e6 *lat and 1000000*;*lat errors

2011-04-24 Thread ingy abbas
   i want to add the  third over lay item so i use this but it doesnt
work what shall i do when i cant use 1e6 and 1E6 any more and 100
force close and i want to add the third overlay item and other
((p3=new GeoPoint( (int) (lat3 * 100), (int) (log3 * 100

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


Re: [android-developers] Intercept/override context menu on EditText long-press?

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 5:54 PM, Keith Wiley kbwi...@gmail.com wrote:
 I want to intercept an EditText long-press and do something with it
 other than present a contextual menu.

Please don't. Users will expect the standard EditText context menu to
appear, so they can do silly things like edit the text. Android
developers get ripped to shreds by users and the media for having zero
UI discipline, breaking existing UI patterns and causing no two apps
to work the same -- your proposal is a case in point.

If your goal is for users to not edit the text, then don't use an EditText.

If your goal is for users to edit the text, leave the context menu
alone, and find some other way to trigger whatever it is that you are
trying to do.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

-- 
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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley


On Apr 24, 3:02 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Apr 24, 2011 at 5:54 PM, Keith Wiley kbwi...@gmail.com wrote:
  I want to intercept an EditText long-press and do something with it
  other than present a contextual menu.

 Please don't. Users will expect the standard EditText context menu to
 appear, so they can do silly things like edit the text. Android
 developers get ripped to shreds by users and the media for having zero
 UI discipline, breaking existing UI patterns and causing no two apps
 to work the same -- your proposal is a case in point.

 If your goal is for users to not edit the text, then don't use an EditText.

 If your goal is for users to edit the text, leave the context menu
 alone, and find some other way to trigger whatever it is that you are
 trying to do.

I understand your point, but you aren't being completely fair.  My
Edit text can detect not only single also double and triple taps (I
had to hack triple tap detection from scratch of course).  I want to
provide additional functionality on double or triple tap long presses,
but it won't work if the contextual menu is forced upon all long
presses.  Furthermore my app offers a fully configurable UI where
single/double/triple taps/long-presses/drags can be assigned to
numerous complex functions in a way that greatly empowers the user.

So, with all due respect, we can debate the philosophy how to present
such UIs in a parallel or separate discussion, but it is tangential to
my question of how to technically achieve such powerful goals.

Do you know how to do what I'm trying to do?

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] How do you counter repeated bogus reviews from competitors?

2011-04-24 Thread MB
Hi,

I am the developer of Android app Gps Ski Maps. We are really
frustrated with competitor writing bogus review about our app(by
buying app multiple times under different accounts and repeatedly
touching the reviews).

 I am wondering how do you deal with this? What steps do you take to
prevent such abuse of Android Market?
We expected some bogus reviews, but not at the scale we saw in Android
Market.
Our app is available on both Android and Blackberry. The spammy review
problems has been really a problem only on Android. Blackberry
reviews( both good and bad:-)) have been mostly genuine as far as I
can tell.
The details of our particular case are written here, but I am more
interested in figuring out the counter steps.

 http://goo.gl/pilTF

Thanks,

--MB
(Developer. Gps Ski Maps)

-- 
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: 1e6 *lat and 1000000*;*lat errors

2011-04-24 Thread lbendlin
put in a log line to print out lat3 and log3.  Make sure they aren't already 
shifted by 1E6.

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

Re: [android-developers] Re: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 6:36 PM, Keith Wiley kbwi...@gmail.com wrote:
 I understand your point, but you aren't being completely fair.  My
 Edit text can detect not only single also double and triple taps (I
 had to hack triple tap detection from scratch of course).  I want to
 provide additional functionality on double or triple tap long presses,
 but it won't work if the contextual menu is forced upon all long
 presses.  Furthermore my app offers a fully configurable UI where
 single/double/triple taps/long-presses/drags can be assigned to
 numerous complex functions in a way that greatly empowers the user.

So?

You have all this stuff for every other touch operation known to
humanity, apparently, yet you can't just leave the long-press alone to
do what an EditText is supposed to do on a long-press? Why not move
your long-press functions to a quadruple tap or something? What is
so magical about you hacking a long-press that is worth
breaking the existing expectations of the users?

 So, with all due respect, we can debate the philosophy how to present
 such UIs in a parallel or separate discussion

You assume that I am here exclusively to help you. I am also here to
put opinions in the record for those who read this thread in the
future (e.g., via a search). I don't want developers thinking that
messing with system menus is a good idea.

 Do you know how to do what I'm trying to do?

The only thing I can think of -- and it's a long shot -- is to call
unregisterForContextMenu() sometime relatively late in the process.
This can also be achieved by calling
setOnCreateContextMenuListener(null) on the EditText itself. I can't
quite see where an EditText/TextView actually declares that it *has* a
context menu. I get the distinct impression from the code I'm reading
that it's somewhat bypassing the normal context menu system. But, in
the off chance you get lucky, if you unregister it sometime after it
has been registered, that might suppress the built-in context menu.

But I really wish you wouldn't.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

-- 
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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
Just to wrap up this thread for anyone else who finds it and is
looking for relevant information, I was able to achieve the intended
goal by overriding showContextMenu() and either passing the call up to
the super class or dropping the call on the floor.  So when my app
detects a double or triple tap in advance of the call to
showContextMenu(), I simply ignore the call and proceed with the
alternate behavior instead.

...and to wrap up the philosophical argument that this thread
unintentionally flared, I really don't see why double or triple tap
long presses should be expected to exhibit redundant behavior with
that of single tap long presses.  The scenario is perfectly analogous
to single, double, and triple taps (sans long press), or mouse-
clicks.  Clearly, no one expects double taps to exhibit behavior
redundant with single taps.  If that were the case, double tap support
would never have been programmed into the API in the first place (and
let's be honest with ourselves, double-mouse-clicks have been a common
UI for 25 years!).  Triple clicks and triple taps, I concede, are a
bit more contentious in that they are not particularly wide-spread,
but they are not unheard of either and I felt entitled to offer such
support to my app's power users who might benefit from the added
flexibility and ease of use.

Mark, I have always appreciated your input and I'm sorry my original
question offended you.  It was technical, not philosophical, and I am
always weary of attempts to thread-jack an original question because
threads rarely recover and the original question generally goes
unanswered as a consequence.  I would have been more than happy to
politely debate the philosophical and design issues with you, but such
was a tangent from the purely technical question I was asking and I
saw no reason to confuse the two topics; I just wanted an answer to my
question (and perhaps faith that I was not running afoul of wise
design specs even if I had not fully qualified the scenario pertaining
to my question).  I hope you aren't too offended by all of this.

Best of luck.

Cheers!

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


Re: [android-developers] Re: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Mark Murphy
On Sun, Apr 24, 2011 at 7:49 PM, Keith Wiley kbwi...@gmail.com wrote:
 ...and to wrap up the philosophical argument that this thread
 unintentionally flared, I really don't see why double or triple tap
 long presses should be expected to exhibit redundant behavior with
 that of single tap long presses.

That seems reasonable. Your opening line of the thread (I want to
intercept an EditText long-press and do something with it other than
present a contextual menu) didn't explain that, and I misunderstood
where you were trying to clarify (I want to provide additional
functionality on double or triple tap long presses,
but it won't work if the contextual menu is forced upon all long presses).

BTW, just so I'm on the right page: a double-tap long-press would be
tap + long-press? And triple-tap long-press is tap + tap + long-press?

And is this a DDR game applied to an EditText? If so, did you license
any cool music? :-)

Regardless, my apologies for misreading that line.

 Mark, I have always appreciated your input and I'm sorry my original
 question offended you.

It's more that I've been running into UI-pattern-jacking a lot over on
StackOverflow in recent months, so I'm overly sensitive on the issue.

 I hope you aren't too offended by all of this.

Not at all. I'm more concerned about *you* being offended, since I'm
the one who misread the key line.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books

-- 
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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
On Apr 24, 4:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Apr 24, 2011 at 6:36 PM, Keith Wiley kbwi...@gmail.com wrote:

 You have all this stuff for every other touch operation known to
 humanity, apparently, yet you can't just leave the long-press alone to
 do what an EditText is supposed to do on a long-press? Why not move
 your long-press functions to a quadruple tap or something? What is
 so magical about you hacking a long-press that is worth
 breaking the existing expectations of the users?

It sounds like you didn't understand my problem.  The contextual menu
was being triggered on the double and trip tap long presses also.
That was fundamental to my problem.  I couldn't prevent it from
happening under reasonable circumstances.  That was what I needed help
with.

 You assume that I am here exclusively to help you. I am also here to
 put opinions in the record for those who read this thread in the
 future (e.g., via a search). I don't want developers thinking that
 messing with system menus is a good idea.

Well, I understand that, but you didn't do both.  You didn't make a
clear philosophical argument and then explain how to achieve the
technical goal of a double-tap long press that does not trigger a
contextual menu.  You stopped half way through.  That was frustrating
from my point of view.

I take your point about the single-tap long press.  I will either
forcibly prevent it from being over-rided in my UI configuration
settings or I will accompany with red flashing alarm-bell associated
warnings that it should only be done if the user is certain they know
what they are doing (I hate telling genuine power users that they
can't do what they want, I love configured UIs to my own nuanced
behaviors, it's the same reason my trackball has gazillions of DOF on
it).  I had already put in a warning message when overriding the long-
press command but you have my thinking that I should make the warning
more aggressive now...or perhaps even lock it out entirely just for
the sake of conformity.  I'll take it under consideration.

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: How do you counter repeated bogus reviews from competitors?

2011-04-24 Thread Maps.Huge.Info
Wow. That really sucks. There is very little you can do about it but I
suggest making sure you mark the comment as spam. I believe if enough
people mark a comment as spam, something kicks in and it either gets
reviewed by a human or is just removed. Put that in your blog or
however you communicate with your users so they do the same. It might
not do anything but then again, I think it does.

Another potentially helpful thing you can do is complain to the
company who wrote the competitive app. It may be the comments are the
work of low level employees and the corporate heads are unaware of
their unethical behavior. Write a blog entry describing exactly what
the problem is, why you think it's your competitor and what steps
you've taken to stop it then notify the CEO and president of the
company. Keep it civil and take the high road. Most executives abhor
bad publicity. Bringing your issue to their attention might just stop
it dead.

-John Coryat

-- 
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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
On Apr 24, 5:00 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Apr 24, 2011 at 7:49 PM, Keith Wiley kbwi...@gmail.com wrote:
  ...and to wrap up the philosophical argument that this thread
  unintentionally flared, I really don't see why double or triple tap
  long presses should be expected to exhibit redundant behavior with
  that of single tap long presses.

 That seems reasonable. Your opening line of the thread (I want to
 intercept an EditText long-press and do something with it other than
 present a contextual menu) didn't explain that,

I admit, I did not qualify my question with much backround.

 BTW, just so I'm on the right page: a double-tap long-press would be
 tap + long-press? And triple-tap long-press is tap + tap + long-press?

Yes, precisely.  Double-tap long-press in my lingo is down-up-dooown.
Triple is down-up-down-up-dooown.  I used similar actions for a
different app almost a year and a half ago (WildSpectra) but they
weren't on an EditText, they were just on a custom view, so the
context menu issue never came up before.

Regarding the actual solution, unless I have mistaken what I am
seeing, it does look like my solution works: override
showContextMenu().

Cheers!

-- 
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: Intercept/override context menu on EditText long-press?

2011-04-24 Thread Keith Wiley
We're talking around each other a little bit as the posts interweave.
Reading the thread in post order will come off needlessly
argumentative in posterity.  Unless I find that my solution is not
working as expected, I'm declared peace made.

Cheers!

-- 
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] SMS -Sending

2011-04-24 Thread kaushik p
Hi,


In my application i need to send and receive sms programmatically . I have
tried using this snippet ,

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(destAddr,
null, mMessageText, null, null);
//exact example is

SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(918147242231,
null,hello, null, null);

but my application is crashing . Please help me in this its very urgent .


Thanks in advance



 --
ThanksRegards
Kaushik Pendurthi

http://kaushikpendurthi.blogspot.com/

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

Re: [android-developers] Re: Wallpaper size

2011-04-24 Thread Dianne Hackborn
Have you made sure you are not running in screen density compatibility mode?

On Sun, Apr 24, 2011 at 11:05 AM, Simon Platten 
simonaplat...@googlemail.com wrote:

 I can get the size of the wallpaper from the wallpaper manager:

 m_context = app.getApplicationContext();
 WallpaperManager wpMngr = WallpaperManager.getInstance(
 m_context );
 m_intWPheight = wpMngr.getDesiredMinimumHeight();
 m_intWPwidth  = wpMngr.getDesiredMinimumWidth();

 I can then get the size of the display area:


 Display display = app.getWindowManager().getDefaultDisplay();
 m_intScrWidth = display.getWidth();
 m_intScrHeight = display.getHeight();

 I have my image that I want to rescale:


 m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
 m_intImgWidth  = m_bmpImage.getWidth();
 m_intImgHeight = m_bmpImage.getHeight();

 Scaling from the Image height to the display height:

 m_fltSFbyHeight = (float)m_intScrHeight /
 (float)m_intImgHeight;

 What I want to do is create a black bitmap that is the same size as the
 wallpaper ( intWPwidth, m_intWPheight ), then copy/blit into this bitmap the
 bitmap to use as the wallpaper re-scaling it to fit if required, so I end up
 with a bitmap image the same size as the wallpaper with the image centered
 and scaled in the middle of it.

 Thank you.



 On Sun, Apr 24, 2011 at 6:39 PM, Simon Platten 
 simonaplat...@googlemail.com wrote:

  Sorry, I should have included the code to resize, once I calculate the
 new width and height I call:

 return Bitmap.createScaledBitmap(m_bmpImage,
 m_intFinalWidth,
 m_intFinalHeight,
 false);



 On 24/04/2011 6:34 PM, Simon Platten wrote:

 When using the code on Android 1.6 platforms, the bitmaps are re-sized as
 aspected, however when used on Android 2.1 its as if the function to rescale
 has no effect what so ever, the wallpapers always come out the wrong size.


 On Sun, Apr 24, 2011 at 9:12 AM, Simon Platten 
 simonaplat...@googlemail.com wrote:

 On Android 1.6 my wallpaper applications resize the wallpapers correctly,
 however on Android 2.1 the resizing doesn't work, its the same on the
 emulator.

 I've tried using both the Matrix and Bitmap.createScaledBitmap both do
 exactly the same and work find on 1.6.  Can anyone explain what is happing
 and why these routines don't work on Android 2.1?

 I start off by getting the device screen size using:

 Display display = app.getWindowManager().
 getDefaultDisplay();
 m_intScrWidth = display.getWidth();
 m_intScrHeight = display.getHeight();

 I load the image from a resource with:

 m_bmpImage = BitmapFactory.decodeResource( m_res, intResId );
 m_intImgWidth  = m_bmpImage.getWidth();
 m_intImgHeight = m_bmpImage.getHeight();
 m_fltSFbyHeight = (float)m_intScrHeight /
 (float)m_intImgWidth;

 Then to scale the image:

 m_intFinalWidth  = (int)((float)m_intImgWidth * m_fltSFbyHeight);
 m_intFinalHeight = (int)((float)m_intImgHeight *
 m_fltSFbyHeight);

 Thank you,
 Simon




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




-- 
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, and so won't reply to such e-mails.  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: SMS -Sending

2011-04-24 Thread Chambras
Did you add the permission in your manifest file
What error do you see in the logcat?

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

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Nikolay Elenkov
On Mon, Apr 25, 2011 at 2:14 AM, David Williams
dwilli...@dtw-consulting.com wrote:

 Thanks,

 That is what I tried, but I wanted to edit the /etc/hosts file and when I 
 tried the push I was told that the file system was read only, so I couldn't 
 push the file.

You can use 'adb remount' to remount /system ready-write.
However, on the emulator it shows up with 0 free space,
so I don't think you can make any changes. Your best bet
is to use a real rooted device, I think.

 adb remount

# mount
...
/dev/block/mtdblock0 /system yaffs2 rw 0 0

#df /system

/system: 77568K total, 77568K used, 0K available (block size 4096)


BTW, sending HTML mails to a mailing list is not considered nice. All
the worse if it has images.

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


Re: [android-developers] Re: SMS -Sending

2011-04-24 Thread kaushik p
Hi ,

 thanks for the reply , i am very new to android  . I have put the
permission in the manifest file uses-permission
android:name=android.permission.SEND_SMS /.

I am not getting any errors the application is not responding and i have to
force stop it .
and what is logcat ?

On Mon, Apr 25, 2011 at 7:18 AM, Chambras marcech...@gmail.com wrote:

 Did you add the permission in your manifest file
 What error do you see in the logcat?

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




-- 
ThanksRegards
Kaushik Pendurthi

http://kaushikpendurthi.blogspot.com/

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

[android-developers] Samsung Galaxy S calendar app on Sprint allows starting Google Maps or Sprint Navigation only to Complete action using when clicking on Location.

2011-04-24 Thread Michael Franz
Hi all,

Samsung Galaxy S calendar app on Sprint allows starting Google Maps or
Sprint Navigation only to Complete action using when clicking on
Location. This is a pretty serious limitation, which does not
allow implementing proper Location processing - for example to dial
conference bridge, typically found in this field.

Note that normally this can be done by using the following intent-filter:

intent-filter
action android:name=android.intent.action.VIEW /
 category android:name=android.intent.category.DEFAULT /
category android:name=android.intent.category.BROWSABLE /
data android:scheme=geo /
/intent-filter

Any ideas on how to overcome this limitation (while still using the built in
calendar app) will be appreciated.

Thanks,
M.

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

Re: [android-developers] Re: SMS -Sending

2011-04-24 Thread Chambras
you can connect to your emulator or device using adb shell and from there 
you can see the log file and see what is the error
here you can find more documentation on this topic
http://developer.android.com/guide/developing/tools/adb.html

-- 
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 Market download statistics broken again?!

2011-04-24 Thread john huang
All my apps download statics haven't been updated for a week. Does
anyone meet the same problem?

John

-- 
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: Android Market download statistics broken again?!

2011-04-24 Thread Zsolt Vasvari
Yes.  Nothing new here, move on.

On Apr 25, 11:10 am, john huang john.h...@gmail.com wrote:
 All my apps download statics haven't been updated for a week. Does
 anyone meet the same problem?

 John

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


Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread David Williams

There is no way whatsoever to do this?


David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie 
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum 
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ 
http://www.dtw-consulting.com/GolfCaddie/faq.html by DTW-Consulting, Inc.




On 4/24/2011 12:40 PM, Mark Murphy wrote:

Well, you can't edit the file, then.

On Sun, Apr 24, 2011 at 1:14 PM, David Williams 
dwilli...@dtw-consulting.com mailto:dwilli...@dtw-consulting.com 
wrote:


Thanks,

That is what I tried, but I wanted to edit the /etc/hosts file and
when I tried the push I was told that the file system was read
only, so I couldn't push the file.


David Williams
Check out our WebOS mobile phone app for the Palm Pre and Pixi:
http://www.dtw-consulting.com/GolfCaddie Golf Caddie
http://www.dtw-consulting.com/GolfCaddie | Golf Caddie Forum
http://www.dtw-consulting.com/GolfCaddie/forum | Golf Caddie FAQ
http://www.dtw-consulting.com/GolfCaddie/faq.html by
DTW-Consulting, Inc.



On 4/24/2011 12:08 PM, Moose wrote:

If I ever need to edit a file, I use the terminal commands

$ adb pull /path/to/file .
*edit the file as you need to to*
$ adb push file /path/to/file

I know there is also a way you can edit a file by using 'cat' in
the android shell, but I prefer to edit a dynamic file and
replace it.
-- 
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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en 
-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.0 Programming Books: http://commonsware.com/books
--
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 


--
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=eninline: GClogo.png

Re: [android-developers] Connect to emulator with Putty?

2011-04-24 Thread Nikolay Elenkov
On Mon, Apr 25, 2011 at 12:45 PM, David Williams
dwilli...@dtw-consulting.com wrote:

 There is no way whatsoever to do this?

Not that I know of.

Lose the HTML and images and do not top post, if you want to expect
any more replies.

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


Re: [android-developers] How to point a marker on google map according to our choice.

2011-04-24 Thread jyotibhusan roul
Hi.actually in my application I have put a marker on default place(e.g
San Jose),but I want to put a marker in another place(e.g Newark),and
get latitude and longitude of the place.This thing I needed.

On Sat, Apr 23, 2011 at 4:40 PM, lbendlin l...@bendlin.us wrote:

 Your question is ambiguous. Please state the problem you have and what you
 have tried to solve it.

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




-- 
Thanks  Regards,

Jyoti Bhusan

-- 
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: How do you counter repeated bogus reviews from competitors?

2011-04-24 Thread Brill Pappin
This has happened to us several time.
We never find any *proof* of which competitor is doing it (except if
they push users to another app), but the pattern makes it obvious
that  your being targeted.

Some of what we've seen:
- Blatant lies about the features.
- Claims stealing from the users.
- Claims of problems and no support (we run a very tight support and
test it daily).
- Simple ones like it sucks.

Almost every time you get multiple 1 or 2 star ratings in a row and/or
multiple different users with similar bad reviews in a row.

It makes me pretty pissed, but we haven't found a good way to counter
it because you don't have any data you can send to Google in order to
get them to do anything about it.
So far the only thing that I've found effective at all is to reply to
the user politely and with a positive action comment (of course your
comment has 5 stars for your own app).

We find that the best way in the end is to actually attempt to provide
a good product. Implement good support and respond to your users. Fix
problems as soon as possible.

For us, the apps don't bring in enough to make it a full time job, so
we have to dedicate ourselves to the most pressing issue when they
crop up.
Even a really bad bug that slips through can be alleviated by good
support and by actually trying to fix it.

What ever you do, remember that some users really don't like your app.
Sometimes they are eloquent and sometimes they are not. In those cases
you can try and address their issues, but you won't make everyone
happy and its important not to deride your user legitimate users who
have a problem.

One other thing. When your app really has a problem, I find its better
to for you to accept it and let your users know you had a problem but
are (or already have) fixed it. They are more likely to trust your
word then.

- Brill Pappin
  Sixgreen Labs Inc.

On Apr 24, 6:55 pm, MB manoj.bi...@gmail.com wrote:
 Hi,

 I am the developer of Android app Gps Ski Maps. We are really
 frustrated with competitor writing bogus review about our app(by
 buying app multiple times under different accounts and repeatedly
 touching the reviews).

  I am wondering how do you deal with this? What steps do you take to
 prevent such abuse of Android Market?
 We expected some bogus reviews, but not at the scale we saw in Android
 Market.
 Our app is available on both Android and Blackberry. The spammy review
 problems has been really a problem only on Android. Blackberry
 reviews( both good and bad:-)) have been mostly genuine as far as I
 can tell.
 The details of our particular case are written here, but I am more
 interested in figuring out the counter steps.

  http://goo.gl/pilTF

 Thanks,

 --MB
 (Developer. Gps Ski Maps)

-- 
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: How do you counter repeated bogus reviews from competitors?

2011-04-24 Thread Brill Pappin
By the way, I just read your open letter.

Maybe a more impartial database needs to be set up listing these
jokers.
Some way we can all report this kind of thing with rules for how
companies get on it and how they get off it.

- Brill Pappin

On Apr 24, 6:55 pm, MB manoj.bi...@gmail.com wrote:
 Hi,

 I am the developer of Android app Gps Ski Maps. We are really
 frustrated with competitor writing bogus review about our app(by
 buying app multiple times under different accounts and repeatedly
 touching the reviews).

  I am wondering how do you deal with this? What steps do you take to
 prevent such abuse of Android Market?
 We expected some bogus reviews, but not at the scale we saw in Android
 Market.
 Our app is available on both Android and Blackberry. The spammy review
 problems has been really a problem only on Android. Blackberry
 reviews( both good and bad:-)) have been mostly genuine as far as I
 can tell.
 The details of our particular case are written here, but I am more
 interested in figuring out the counter steps.

  http://goo.gl/pilTF

 Thanks,

 --MB
 (Developer. Gps Ski Maps)

-- 
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] Fragmentation-resistant product design

2011-04-24 Thread Vikram
Guys

We have noticed that while all the phones (that we have seen) store
photo timestamps in the Local timezones in which they were clicked,
the Motorola Droid Pro store EXIF photo timestamps in GMT. The photo
viewer shows it in the timezone of the viewer (Confirmed by
https://supportforums.motorola.com/thread/39204).

Any advice on how to handle this issue more from a design perspective?
As we keep identifying more issues of this sort, we are adding
abstractions at different points where our code interacts with the
system. Is this the way to go? Also, any advice on how to identify a
device? We are planning to use make and model keywords like
Make=Motorola, Model=DROID PRO, Product=venus2_vzw, Device=verizon/
venus2_vzw/cdma_venus2/venus2:2.2.1/3.4.2_80_V2_87/8:user/release-
keys

Vikram

-- 
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] Market sales suddenly cut in half

2011-04-24 Thread Brill Pappin
All of a sudden on April 20th, our daily payout dropped to half the
normal sales/day.
It has been consistently half ever since across all of our apps.

Has anyone else notice that kind of drop in the last four days or so?

- Brill Pappin

-- 
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] CheckedTextView and filtering of list not working well together

2011-04-24 Thread Lowell Kirsh
I have a list of checkable items and an EditText which I use to filter this 
list of items. If I check, say, the second item in the list and then filter 
the list by entering some text in the EditText, it will keep the second list 
item checked even though, after filtering, that might be a different item 
than was originally checked. What pattern should I use to be associating the 
checked state with the backing object rather than its index within the list?

Thanks
Lowell

-- 
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] Wifi lock with WIFI_MODE_SCAN_ONLY

2011-04-24 Thread seema
Hello All,

   Here is what I do to scan on wifi while connected to 3G.

WifiLock wifiLock =
wifiService.createWifiLock(WifiManager.WIFI_MODE_SCAN_ONLY,
MyLock);

if(!wifiLock.isHeld()){
wifiLock.acquire();
}

if(wifiService.isWifiEnabled() == false){
 wifiService.setWifiEnabled(true);
 }

Is my usage of WIFI_MODE_SCAN_ONLY is correct. It did not work for me.
When I enable Wifi, it automatically connects to the remembered
network. I just want to scan but not connect.

Regards,
Seema

-- 
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: Live Wallpaper, Menu button etc in different languages

2011-04-24 Thread Mark Carter
I asked the same question here about 18 months ago:

https://groups.google.com/forum/#!topic/android-developers/siCqOHHlrac

but sadly got no answers :(

I had an idea of using a statistical approach by parsing through all strings 
xml files on all the apps on a device and listing the most common 
translations for each language. Don't think I'll have time to implement it 
though :(

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