[android-developers] Re: Override default icons of BaseExpandableListAdapter

2010-03-15 Thread Ali Chousein
TreKing, thank you for your messages so far. I won't give up for some
more days and will try to make it work. If I find a way I'll share
with the group as well, because as it seems many other people
attempted doing what I try to do now and faced similar issues.

-- 
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: General lag issues with real-time games

2010-03-15 Thread Bob Kerns
Now that you point it out, I suspect some people have a serious, basic
misconception here.

The world in stop-the-world GC is simply THAT VM INSTANCE. Which
usually maps to that process, though it's theoretically possible to
have non-Java threads that continue to run, so long as they don't
touch Java stuff. It does NOT AFFECT other processes.

Other processes are just that. Other processes. Their GC is *ENTIRELY
INTERNAL* to their behavior. It is just some more CPU work that
process does just like any other CPU work. The only visible
characteristics of their GC are:
1) GC occurs in spurts of a particular size, so a period of GC
operation will never be less than a certain interval. The total
interval may be longer, because it's always merged with the other CPU
work being done.
2) GC tends to touch a lot of memory, which can trigger paging
activity
3) GC prints out into the logcat log that it's happening.

I repeat: GC work in other processes has no SPECIAL impact on your
process. It's just some work going on in a competing process.

The stop-the-world aspect of GC is simply that this GC can't handle
other threads changing THIS PROCESS'S memory while it's doing its
work. Each application runs in its OWN PROCESS. (Except you can
arrange for two of your own apps to run in the same process. They get
loaded by separate classloaders, though, so there's even less reason
to do this than you might suppose).

GC in your OWN process has a very different, VASTLY larger impact. The
two are simply not comparable situations.

Thank you for your nice empirical demonstration of this. I hope this
spares people from focusing overmuch on details of what other
processes are dong.

On Mar 14, 4:33 pm, Lance Nanek lna...@gmail.com wrote:
 Good point. Some quick trials here do seem to indicate that the GC
 firing in a different process doesn't stop the world for a game like
 the GC firing in the game's does. So GC from other processes isn't as
 bad. Tested on a Droid running Android 2.0.1.

-- 
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 use Java Runtime class in Android for starting another application from mine

2010-03-15 Thread Sudheendra
Hi i have gone through the Resource and wrote a code for launching
Notepad through a launcher program . (Downloaded the Notepad code from
google ) But i am getting and Error saying Process
com.intent.launcher has stopped unexpectedly . My code goes like this


Launcher.Java

package com.intent.launcher;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;


public class launcher extends Activity {
/** Called when the activity is first created. */
@Override

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
   Intent i  =  new
Intent(this,com.android.demo.notepad1.Notepadv1.class);
   startActivity(i);

}
}

AndroidManifest.Xml

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.intent.launcher
  android:versionCode=1
  android:versionName=1.0
uses-permission android:name=android.permission.INTERNET /
provider android:name=.Notepadv1
android:authorities=com.android.demo.notepad1 /
application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.launcher
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

/application

uses-sdk android:minSdkVersion=5 /

/manifest

Can u please tell me the Error in  this code..

Thanks ,







On Mar 14, 2:18 pm, TreKing treking...@gmail.com wrote:
 On Sun, Mar 14, 2010 at 2:11 AM, Sudheendra sudhindra.ma...@gmail.comwrote:

  Can u please guide me for a resource which talks about generic intents
  and how to use them.

 How about the official documentation? Just a 
 thought.http://developer.android.com/intl/de/reference/android/content/Intent...

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://sites.google.com/site/rezmobileapps/treking

-- 
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 use Java Runtime class in Android for starting another application from mine

2010-03-15 Thread Sudheendra

Also console in Eclipse is giving me this info
[2010-03-15 12:32:00 - Exoda] --
[2010-03-15 12:32:00 - Exoda] Android Launch!
[2010-03-15 12:32:00 - Exoda] adb is running normally.
[2010-03-15 12:32:01 - Exoda] Performing com.intent.launcher.launcher
activity launch
[2010-03-15 12:32:04 - Exoda] Automatic Target Mode: using device
'HT94PL900012'
[2010-03-15 12:32:05 - Exoda] Uploading Exoda.apk onto device
'HT94PL900012'
[2010-03-15 12:32:09 - Exoda] Installing Exoda.apk...
[2010-03-15 12:32:12 - Exoda] Success!
[2010-03-15 12:32:12 - Exoda] Project dependency found, installing:
Notepadv1_Sol
[2010-03-15 12:32:12 - Notepadv1_Sol] Uploading Notepadv1_Sol.apk onto
device 'HT94PL900012'
[2010-03-15 12:32:13 - Notepadv1_Sol] Installing Notepadv1_Sol.apk...
[2010-03-15 12:32:17 - Notepadv1_Sol] Success!
[2010-03-15 12:32:17 - Exoda] Starting activity
com.intent.launcher.launcher on device
[2010-03-15 12:32:20 - Exoda] ActivityManager: Starting: Intent
{ act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] cmp=co



On Mar 14, 2:18 pm, TreKing treking...@gmail.com wrote:
 On Sun, Mar 14, 2010 at 2:11 AM, Sudheendra sudhindra.ma...@gmail.comwrote:

  Can u please guide me for a resource which talks about generic intents
  and how to use them.

 How about the official documentation? Just a 
 thought.http://developer.android.com/intl/de/reference/android/content/Intent...

 --- 
 --
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://sites.google.com/site/rezmobileapps/treking

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


[android-developers] Need custom arc shape for seek bar

2010-03-15 Thread Tanay Shah
Hi,

Is it possible to have an arc shaped seek bar in android ?

Thanks,
Tanay

-- 
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: 3G Wi-Fi at same time

2010-03-15 Thread Tanmay
Hey,
Thanks for the reply.
You reckon I should have a look at the routing table before making
these changes or after? Yes, from the forums I have seen that Wi Fi is
the preferred link. However, I am not sure whether it switches to 3G
in case it cannot connect to the internet via the Wi-Fi network which
is connected, but is purely local and cannot take it to any website.

Cheers
Tanmay

On Mar 15, 1:38 pm, Ricardo Silva ban...@gmail.com wrote:
 Hi,

 See the route table, because the default route will be the WLAN, I think.
 Because is the normally the preferred network (changes to 3G). Otherwise, it
 will work.

 Regards,
 Ricardo Silva



 On Sun, Mar 14, 2010 at 11:06 PM, Tanmay tanm...@gmail.com wrote:
  Hi,
  This seems to be what I am looking for. However, just to confirm, I
  will give a short description of what I am trying to do:
  I am trying to use Wifi for an internal WLAN connection (which would
  not be accessing the internet) , and a 3G network to give me access to
  the internet at any time.

  Hope I am going down the right track. I will try doing these changes
  and seeing how it goes.

  Please let me know if these are not required/ will not solve the
  problem I described.

  Thanks

   3, 2:35 am, Ricardo Silva ban...@gmail.com wrote:
   Hello,

   here is a solution (only for testing and research, not for product) to
   have the cellular data andwifiat the same time.

   Warning: need root

   1. pull build.prop from system

   adb pull /system/build.prop .

   2. Change ro.built.type property:

   from: ro.built.type=userdebug (on ADP1)

   to: ro.built.type=eng

   3. Add property:

   cm.test.mode=true

   4. Remount system:

   adb root
   adb shell
   mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
   exit

   5. Push build.prop:

   adb push build.prop /system

   6. reboot :)

   Some one knows if is possible to change the source code of the
   ConnecitivityService.java and push to Android system (without install
   a new image)? I think that is possible compiling a new core.jar and/or
   ext.jar, correct?

   cya

  --
  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.comandroid-developers%2Bunsubs 
  cr...@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: Saving/Restoring ListCustomClass

2010-03-15 Thread ko5tik


On Mar 15, 6:24 am, Kumar Bibek coomar@gmail.com wrote:
 But I couldn't think of s situation where you will need it. Shared
 preferences are not a way to store your data. Either use the database
 or a file(xml).

It's possible though.  As they are stored as  XML, it's basically the
same
as your own xml file (and you save reading and parsing)

But it's better to store in your own xml file.

You may also use some kind of XML data binding (like XStream, but
it's
a little heavyweight for a phone )

I personally use JSON ( as JSON parse and write is part of android
java environment)
but my own JSON databinding does not support cvollections yet (due to
lack of use case
and contributions )
In case you like to give it a try and  improve it:
http://github.com/ko5tik/jsonserializer

regards,

-- 
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: Petition: Google, please improve the Android Market.

2010-03-15 Thread Chister Nordvik
Just wanted to add my vote to this also. I have submitted our app to:
- Ovi Store
- Windows Mobile Marketplace
- iPhone App Store
- Samsung App Store (WM)
- Android Market

And not to start a riot here, but all of the above has better
functionality than the Android Market. Longer descriptions, more
screenshots, better reports, possibility to get device ID, multiple
versions of the same program ++.

Before the summer of 2009 I received emails all the time about the
expansion of Android Market but the last 9 months it's been all quiet.
No new countries are being added to buy paid apps anymore. I've been
hoping that it is due to a massive upgrade of the Android Market but
after 9 months I am not so sure anymore. Could it be that Google wants
the operators to run their own markets? Like Sony Ericsson (PlayNow)
and Motorola are doing? I really hope that Android is not going in a
direction where each brand have their own market.

-Christer

On Mar 15, 2:57 am, JP joachim.pfeif...@gmail.com wrote:
 I just signed. A must for anybody who has an app out with even just
 modestly complex functionality.
 Over the last weeks I've seen a shift to comments that are
 predominantly negative in nature now.
 There seems just no way any more to convey to users to visit the
 accompanying web site and RTFM.
 So the Market must grow in its ability to effectively present apps and
 allow to respond to comments.
 Thank for putting this together, Rob.

 JP

 On Mar 14, 5:45 am, Rob Irondad rob.iron...@gmail.com wrote:

  Hello, fellow developers,

  Just a quick update on the petition.
  As of now it has been signed by almost 1000 people.
  I don't know how many Android developers there are globally, but I
  think this is a pretty good number
  It was also mentioned on a few websites, but nothing major.

  So far, we still have no sign of a reaction from Google, and all the
  points in the petition remain valid.

  Petition link:http://petitiononline.com/androidm

  --
  Rob

-- 
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 MediaPlayer current volume

2010-03-15 Thread kavitha
Hi All,

I am developing an application of music player in android.

I need to show volume control in my application.

I saw as per documentation,Media Player volume is 0-1.

I saw one method as
MediaPlayer.setVolumehttp://developer.android.com/reference/android/media/MediaPlayer.html#setVolume%28float,%20float%29(float
leftVolume, float rightVolume)  to set the volume for mediaplayer.

But I need to show current volume also in slider,,,there is no method to get
current volume.

Any idea how to get it???

Thanks
Kavitha

-- 
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] Button in ListView

2010-03-15 Thread Anton Pirker

Hello List!

I have a problem that some other people on this list (and other android 
sites) also have/had, but was unable to find a solution.

I have a ListView with a custom view for the row which looks like this:

RelativeLayout
   ToggleButton/
   TextView/
/RelativeLayout

Its basically a list of songs that i show. What i want to achieve:

If the user clicks on the ToggleButton the song should be played.
If the user clicks somewhere else on the row, the details intent of the 
song should be launched.


So I want to have two events on every row, event1: the button click, 
event2: click somewhere except on the button.


Right now i have a custom adapter where i call .setOnClickListener() on 
the button. Now the button works (event1 works), the song is played, but 
the rest of the row is not clickable (event2 does not work). If i remove 
the call to setOnClickListener() the row is clickable (event1 works) and 
the details are displayed as suppossed, but the button is not working. 
(event1 does not work)


There are apps out there, that have buttons in lists so this must be 
possible.
Could someone please tell me how to have more than one click event on a 
lists row?


I have found a solution that reads: You have to use TouchDelegate But 
i do not have a clue how! If someone knows how a solution with 
TouchDelegate looks like, please explain it to me!


Thanks,
Anton

--
DI(FH) Anton Pirker

--
cross platform mobile software
burggasse 123/53
a-1070 wien
tel: +43 699 1234 0 456
skype: antonpirker

http://anton-pirker.at



--
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] EditText hides Text

2010-03-15 Thread Falko Richter
Did anyone else knows this issue?
http://code.google.com/p/android/issues/detail?id=7160 and has had a
similar problem with an EditText? The text is hidden on the bottom of
the EditText and I do not see where this is coming from

Falko

-- 
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] showing media volume controller

2010-03-15 Thread murali raju
use seekbar widget and media player class, to control the  the volume use
setvolume()

http://developer.android.com/reference/android/media/MediaPlayer.html

On Mon, Mar 15, 2010 at 11:14 AM, kavitha kavith...@gmail.com wrote:

 Thanks for response Murali raju,,,

 Please tell how to create our own volume control?
 Any ideas  to start with?

 Thanks
 kavitha



 On Sun, Mar 14, 2010 at 10:20 AM, murali raju manutd...@gmail.com wrote:

 Hi,

We have to create our view for volume control. i dont think we can
 display the android media player volume screen.

 On Sat, Mar 13, 2010 at 3:24 PM, kavitha kavith...@gmail.com wrote:

 Hi All,

 how to show media volume controller on my screen in android?

 Thanks
 kavitha

 --
 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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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: Image Edition

2010-03-15 Thread ReyLith
Thank for you respond.

I am already using intent for moving from one activity to another and
I have declared it in the androidmanifest. The code that I am using is
the following:

public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Gallery g = (Gallery) findViewById(R.id.Gallery);
g.setAdapter(new ImageAdapter(this));

g.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView parent, View v, int
position, long id)
{
//Toast.makeText(Editor.this,  + position,
Toast.LENGTH_SHORT).show();
}
});

ImageButton abrir = (ImageButton)
findViewById(R.id.ImageButton01);
abrir.setOnClickListener(abrirImagen);

ImageButton cerrar = (ImageButton)
findViewById(R.id.ImageButton01);
cerrar.setOnClickListener(cerrarPrograma);
}

   /*private OnClickListener abrirImagen = new OnClickListener()
{
   public void onClick(View v)
   {
   Intent intent = new Intent();
   intent.setClass(Editor.this, Rotar.class);
   startActivity(intent);
   finish();
   }
};*/

   private OnItemClickListener seleccionImagen = new
OnItemClickListener()
{
   public void onItemClick(AdapterView parent, View v, int
position, long id)
   {
   Intent intent = new Intent();
   intent.setClass(Editor.this, Rotar.class);
   startActivity(intent);
   finish();
   }
};

The commented function is where I use the botton and the non-commented
funcion is where I want to go to another activity. If someone wants I
can put the complete code but I think that there isn't neccesary. As
you can see I use intents for open the other activity but I don't know
how I can pass the selected image.

Greetings.

-- 
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] Button in ListView

2010-03-15 Thread NapoleonLiu

Hi
 I have the same problem , at last i do it like this
I write two GestureListener, implement onSingleTapUp method.
set both the button and other view's clickable to false
and set them OnTouchListener(NOT onClickListener) with GestureListener.
if you haven't used GestureListener, you can learn it from ApiDemos.
On Mon, 15 Mar 2010 16:26:32 +0800, Anton Pirker an...@ignaz.at wrote:


Hello List!

I have a problem that some other people on this list (and other android  
sites) also have/had, but was unable to find a solution.

I have a ListView with a custom view for the row which looks like this:

RelativeLayout
ToggleButton/
TextView/
/RelativeLayout

Its basically a list of songs that i show. What i want to achieve:

If the user clicks on the ToggleButton the song should be played.
If the user clicks somewhere else on the row, the details intent of the  
song should be launched.


So I want to have two events on every row, event1: the button click,  
event2: click somewhere except on the button.


Right now i have a custom adapter where i call .setOnClickListener() on  
the button. Now the button works (event1 works), the song is played, but  
the rest of the row is not clickable (event2 does not work). If i remove  
the call to setOnClickListener() the row is clickable (event1 works) and  
the details are displayed as suppossed, but the button is not working.  
(event1 does not work)


There are apps out there, that have buttons in lists so this must be  
possible.
Could someone please tell me how to have more than one click event on a  
lists row?


I have found a solution that reads: You have to use TouchDelegate But  
i do not have a clue how! If someone knows how a solution with  
TouchDelegate looks like, please explain it to me!


Thanks,
Anton



---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. 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] Loading Screen not showing, instead blank screen coming

2010-03-15 Thread Nithin
Hi,

In onCreate(), first I am drawing the loading screen, then calling a
handler, which will create the database and inserting contents. But
when executing, its not showing the loadingScreen. Its just showing
the blank screen for few seconds and drawing the page directly after
creating database.

The inference I got was, the onCreate loop is executing till end, so
there is no time to call the loading screen. Handler is creating a
seperate thread and we have UI thread, so in UI thread, I am drawing
the loadingScreen and in handler, creting the database and inserting
contents

How to solve this ? Any Idea please.

Nithin

-- 
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] write/read log files in res folder

2010-03-15 Thread Sean Hodges
No. You can't write into your APK file. Write your log data to the SD
card instead.

On Sat, Mar 13, 2010 at 7:07 AM, aswani kumar tholeti
ensisinf...@gmail.com wrote:

 Hi all,

 how to write/read log data into txt file in res folder

 Thanks in advance

 Aswan

 --
 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] How to get MediaPlayer current volume

2010-03-15 Thread kavitha sunil
AudioManager audMgr = getSystemService(Context.AUDIO_SERVICE);
  int volume = audMgr.getStreamVolume(AudioManager.STREAM_MUSIC);
Change the argument to getStreamVolume accordingly.

On Mon, Mar 15, 2010 at 1:48 PM, kavitha kavith...@gmail.com wrote:

 Hi All,

 I am developing an application of music player in android.

 I need to show volume control in my application.

 I saw as per documentation,Media Player volume is 0-1.

 I saw one method as 
 MediaPlayer.setVolumehttp://developer.android.com/reference/android/media/MediaPlayer.html#setVolume%28float,%20float%29(float
 leftVolume, float rightVolume)  to set the volume for mediaplayer.

 But I need to show current volume also in slider,,,there is no method to
 get current volume.

 Any idea how to get it???

 Thanks
 Kavitha




 --
 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.comandroid-developers%2bunsubscr...@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: Catch HTTP error code with WebView

2010-03-15 Thread Manuel Vela
Ok, the only solution I've found is to create an HTTPClient to create
connection and do a Get petition. With this method I can get
everything (header, status... etc) in the response and then give all
datas to the Webview with webView.loadDataWithBaseUrl.
Something like this:

HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(http://ja.wikipedia.org/wiki/刀;;);
HttpResponse response;

BufferedReader real_response = null;
try {
response = httpclient.execute(httpget);
new InputStreamReader(
response.getEntity().getContent(), UTF-8));
} catch (Exceptionn e) {
e.printStackTrace();
}
if (real_response != null)
{
String data = ;
String tempdata = ;
try {
while ((tempdata = real_response.readLine()) !
= null)
{
data += tempdata;
}
} catch (Exception e) {
e.printStackTrace();
}
wv.loadDataWithBaseURL(http://www.lliane.com/;;,
data,
text/html,
UTF-8,
about:blank);
}

-- 
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] send dtmf

2010-03-15 Thread saru
Hey Can any one please tell me how to send dtmf in android.any code
regarding it would be appreciated.

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


[android-developers] database corruption in web view on nexus one

2010-03-15 Thread Clifford
Hi,

I am having issues with database corruption on the nexus one (running
2.1 update 1). I have multiple internal dbs and occasionally get
database corruption when running on the nexus one. I had been assuming
it was something I was doing wrong, however I've just had a crash just
using the webview that appears to show the same issue while it is
trying to access its own database. I've never written any custom code
to access this db.

Has anyone else come across this, could there be a SQLite bug on the
platform?

The only code I have accessing the webview is (I've edited the string
slightly for clarity):

String myHtml = htmlbodyMy HTML/body/html;
Webview webView = (WebView)findViewById(R.id.my_webview);
Webview webView.loadData(myHtml, text/html, UTF-8);

And the exception that this produced was:

03-15 09:24:47.676 W/ExpatReader(  496): DTD handlers aren't supported.
03-15 09:24:47.876 E/Database(  496): Removing corrupt database: /data/
data/com.anon.mobile.android/databases/webviewCache.db
03-15 09:24:47.886 W/dalvikvm(  496): threadid=29: thread exiting with
uncaught exception (group=0x4001b180)
03-15 09:24:47.886 E/AndroidRuntime(  496): Uncaught handler: thread
WebViewCoreThread exiting due to uncaught exception
03-15 09:24:47.896 E/AndroidRuntime(  496):
android.database.sqlite.SQLiteDatabaseCorruptException: database disk
image is malformed
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:75)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:288)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:269)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.AbstractCursor.moveToPosition(AbstractCursor.java:
171)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.webkit.WebViewDatabase.getCacheTotalSize(WebViewDatabase.java:
662)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.webkit.CacheManager.trimCacheIfNeeded(CacheManager.java:500)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.webkit.BrowserFrame.handleMessage(BrowserFrame.java:366)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.os.Handler.dispatchMessage(Handler.java:99)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.os.Looper.loop(Looper.java:123)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:611)
03-15 09:24:47.896 E/AndroidRuntime(  496): at
java.lang.Thread.run(Thread.java:1096)
03-15 09:24:47.916 I/Process (   78): Sending signal. PID: 496 SIG: 3
03-15 09:24:47.916 I/dalvikvm(  496): threadid=7: reacting to signal 3
03-15 09:24:48.006 I/dalvikvm(  496): Wrote stack trace to '/data/anr/
traces.txt'


Note this doesn't happen every time, and I can't reproduce it
faithfully. However some combination of actions can cause database
corruption to occur. I'll let you know if I can find any more useful
information, or a way to reproduce it but if anyone knows a possible
cause for this, or has seen it themselves, I'd appreciate any
guidance. Thanks!


Cliff

-- 
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: 3G Wi-Fi at same time

2010-03-15 Thread Ricardo Silva
After the changes.

Yes, Android switch to 3G if can not obtain a default gateway (from DHCP or
statically configured) in the Wi-Fi network. And then will use 3G for
Internet and Wi-Fi for the local addresses.

Then, a easy way is to configure the WiFi interface with a static IP (like
192.168.0.1, same address range as the Wi-Fi network) and a mask
(255.255.255.0), and leave the gateway and DNS fields empty. Then confirm if
the route table has the 3G network as default gateway. Use the command
netcfg in the ADB to see that (in Hex, the default gateway is all zeros) or
use the busybox for Android which have the normal route command from Linux.

Regards,
Ricardo Silva


On Mon, Mar 15, 2010 at 7:29 AM, Tanmay tanm...@gmail.com wrote:

 Hey,
 Thanks for the reply.
 You reckon I should have a look at the routing table before making
 these changes or after? Yes, from the forums I have seen that Wi Fi is
 the preferred link. However, I am not sure whether it switches to 3G
 in case it cannot connect to the internet via the Wi-Fi network which
 is connected, but is purely local and cannot take it to any website.

 Cheers
 Tanmay

 On Mar 15, 1:38 pm, Ricardo Silva ban...@gmail.com wrote:
  Hi,
 
  See the route table, because the default route will be the WLAN, I think.
  Because is the normally the preferred network (changes to 3G). Otherwise,
 it
  will work.
 
  Regards,
  Ricardo Silva
 
 
 
  On Sun, Mar 14, 2010 at 11:06 PM, Tanmay tanm...@gmail.com wrote:
   Hi,
   This seems to be what I am looking for. However, just to confirm, I
   will give a short description of what I am trying to do:
   I am trying to use Wifi for an internal WLAN connection (which would
   not be accessing the internet) , and a 3G network to give me access to
   the internet at any time.
 
   Hope I am going down the right track. I will try doing these changes
   and seeing how it goes.
 
   Please let me know if these are not required/ will not solve the
   problem I described.
 
   Thanks
 
3, 2:35 am, Ricardo Silva ban...@gmail.com wrote:
Hello,
 
here is a solution (only for testing and research, not for product)
 to
have the cellular data andwifiat the same time.
 
Warning: need root
 
1. pull build.prop from system
 
adb pull /system/build.prop .
 
2. Change ro.built.type property:
 
from: ro.built.type=userdebug (on ADP1)
 
to: ro.built.type=eng
 
3. Add property:
 
cm.test.mode=true
 
4. Remount system:
 
adb root
adb shell
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
exit
 
5. Push build.prop:
 
adb push build.prop /system
 
6. reboot :)
 
Some one knows if is possible to change the source code of the
ConnecitivityService.java and push to Android system (without install
a new image)? I think that is possible compiling a new core.jar
 and/or
ext.jar, correct?
 
cya
 
   --
   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.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@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.comandroid-developers%2bunsubscr...@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] Not able to access camera-----plzzz help

2010-03-15 Thread prachi
Hii alll

I hav a peice of code to draw a view on camera preview.It as
follows:--

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.hardware.Camera;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.ViewGroup.LayoutParams;

public class TestCameraOverlay extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

Preview mPreview = new Preview(this);
DrawOnTop mDraw = new DrawOnTop(this);

setContentView(mPreview);
addContentView(mDraw, new LayoutParams
(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

}

}

class DrawOnTop extends View {

public DrawOnTop(Context context) {
super(context);
// TODO Auto-generated constructor stub
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub

Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.BLACK);
canvas.drawText(Test Text, 10, 10, paint);

super.onDraw(canvas);
}

}

//--

class Preview extends SurfaceView implements SurfaceHolder.Callback {
SurfaceHolder mHolder;
Camera mCamera;

Preview(Context context) {
super(context);

// Install a SurfaceHolder.Callback so we get notified when
the
// underlying surface is created and destroyed.
mHolder = getHolder();
mHolder.addCallback(this);
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}

public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created, acquire the camera and tell
it where
// to draw.
mCamera = Camera.open();
mCamera.setPreviewDisplay(holder);
}

public void surfaceDestroyed(SurfaceHolder holder) {
// Surface will be destroyed when we return, so stop the
preview.
// Because the CameraDevice object is not a shared resource,
it's very
// important to release it when the activity is paused.
mCamera.stopPreview();
mCamera = null;
}

public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
// Now that the size is known, set up the camera parameters
and begin
// the preview.
Camera.Parameters parameters = mCamera.getParameters();
parameters.setPreviewSize(w, h);
mCamera.setParameters(parameters);
mCamera.startPreview();
}

}

But is is showing me an exception--Permission denial cant
use the camera.

I have included the permissions in manifest file also

Plzz help me out

-- 
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] send dtmf

2010-03-15 Thread Mark Murphy
saru wrote:
 Hey Can any one please tell me how to send dtmf in android.any code
 regarding it would be appreciated.

Try ToneGenerator:

http://developer.android.com/reference/android/media/ToneGenerator.html

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

Android Training in US: 14-18 June 2010: http://bignerdranch.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] Not able to access camera-----plzzz help

2010-03-15 Thread Mark Murphy
prachi wrote:
 But is is showing me an exception--Permission denial cant
 use the camera.
 
 I have included the permissions in manifest file also

Presumably, there is a problem still in the manifest file. Compare yours
with this one:

http://github.com/commonsguy/cw-advandroid/blob/master/Camera/Picture/AndroidManifest.xml

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

Android Training in US: 14-18 June 2010: http://bignerdranch.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] Latest-prorams

2010-03-15 Thread ahmed aglaan
hello to every one

this blog specialized in the latest programs for PC and laptop as it
offers everything that is new in the programs

please help me and write your opinion at chat box at top right of the
blog

http://latest-programs.blogspot.com

Thank you for your interest

-- 
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: Not able to access camera-----plzzz help

2010-03-15 Thread prachi
Hii Mark

I have gone through the manifest file.Im also including the same set
of permissions in my manifest fileee...

Could there be some other reason else dan dis?

On Mar 15, 2:55 pm, Mark Murphy mmur...@commonsware.com wrote:
 prachi wrote:
  But is is showing me an exception--Permission denial cant
  use the camera.

  I have included the permissions in manifest file also

 Presumably, there is a problem still in the manifest file. Compare yours
 with this one:

 http://github.com/commonsguy/cw-advandroid/blob/master/Camera/Picture...

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

 Android Training in US: 14-18 June 2010:http://bignerdranch.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] Getting contacts when ids are known

2010-03-15 Thread Pankaj
Hi,

I have a list of 'n' contact ids corresponding to which I need to
obtain the contact details. One simple way to make n queries using the
contact ids and retrieve those contacts. But this will be very time-
consuming especially if n is large. I would like to know if there is
any simpler way to obtain these results (like batch query etc).

-- 
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: Not able to access camera-----plzzz help

2010-03-15 Thread Mark Murphy
prachi wrote:
 I have gone through the manifest file.Im also including the same set
 of permissions in my manifest fileee...

Perhaps they are in the wrong place in the file.

 Could there be some other reason else dan dis?

For that error? Not that I am aware of.

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

Android Training in NYC: 1-2 May 2010: http://guruloft.com

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


[android-developers] Re: Not able to access camera-----plzzz help

2010-03-15 Thread prachi
ok thanx mark

On Mar 15, 3:22 pm, Mark Murphy mmur...@commonsware.com wrote:
 prachi wrote:
  I have gone through the manifest file.Im also including the same set
  of permissions in my manifest fileee...

 Perhaps they are in the wrong place in the file.

  Could there be some other reason else dan dis?

 For that error? Not that I am aware of.

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

 Android Training in NYC: 1-2 May 2010:http://guruloft.com

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


[android-developers] Re: Not able to access camera-----plzzz help

2010-03-15 Thread prachi
i hav placed the permissions as mentioned in the manifest file by you
bt dnt know where the code is crashing...

Anywayzz thanx for ur help mark

On Mar 15, 3:22 pm, Mark Murphy mmur...@commonsware.com wrote:
 prachi wrote:
  I have gone through the manifest file.Im also including the same set
  of permissions in my manifest fileee...

 Perhaps they are in the wrong place in the file.

  Could there be some other reason else dan dis?

 For that error? Not that I am aware of.

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

 Android Training in NYC: 1-2 May 2010:http://guruloft.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] mp3 player application with dB amplifier

2010-03-15 Thread Adrian Vintu
Hello all,

I need a simple mp3 player - with the functionality of the default Android
player - with one small addition.
I need to be able to up the sound volume more than the VolumeUp button can
do.

I see you can do that in Winamp from the Equalizer window, by choosing
Preamp.

Why do i need this: because many of my albums were ripped at a low sound
volume, and i can barely hear them on the subway.

Is there such a player available on the market?

There are some catches though:
1. must be as simple as possible
2. must be able to upgrade the volume without destroying the sound quality
too much
3. must be free.

Thank you,
BR,
Adrian Vintu

-- 
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] Camera inaccessible---plzz help

2010-03-15 Thread prachi
Hiii

I jst wanna know that is it lyk that camera application does not work
for platform 2.1 or something?

-- 
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: send dtmf

2010-03-15 Thread saru
Thanks Murphy for ur reply.

I explored ToneGenerator class. Where i m seeing one function
 startTone(int toneType)
This method starts the playback of a tone of the specified type.

But i need a function like sendDtmf().

Please can you help again???

On Mar 15, 4:52 pm, Mark Murphy mmur...@commonsware.com wrote:
 saru wrote:
  Hey Can any one please tell me how to send dtmf in android.any code
  regarding it would be appreciated.

 Try ToneGenerator:

 http://developer.android.com/reference/android/media/ToneGenerator.html

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

 Android Training in US: 14-18 June 2010:http://bignerdranch.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] strange exception when calling getBlob

2010-03-15 Thread Sandy
Hi all

   I'm using blob to store encoded byte data. It could be stored.
  But when I try to read it ,application throws
android.database.sqlite.SQLiteException: unknown error: INTEGER data
in getBlob_native.
  I just try to change other way to encode byte data and then put it
in blob field , the exception will gone.
   I really want to know why i got this exception.
   thanks

-Sandy


-- 
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: setting an icon in the application.

2010-03-15 Thread NewDev
Hi,

Thanks for the reply. Yes, I used the GridView and
SetOnItemClickListener. Now am able to click on any icon and display
the details on other screen. I have a second screen or activity,
clicking on first icon it should open the second screen and clicking
on second icon it should open the third screen . But now when I click
on any icon, the same second screen is displayed. I am using intents.
So I am not getting how to achieve this? Could you please help me.

This is my code:

package com.android.grid_hello;


import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
import android.content.Intent;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView;

public class grid_hello extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.grid_new);

GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));

gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView? parent, View v, int
position, long id) {

Intent intent1 = new
Intent(grid_hello.this,second.class);
startActivity(intent1);
}
});
}

public class ImageAdapter extends BaseAdapter {
private Context mContext;

public ImageAdapter(Context c) {
mContext = c;
}

public int getCount() {
return mThumbIds.length;
}

public Object getItem(int position) {
return null;
}

public long getItemId(int position) {
return 0;
}

// create a new ImageView for each item referenced by the
Adapter
public View getView(int position, View convertView, ViewGroup
parent) {
ImageView imageView;
if (convertView == null) {  // if it's not recycled,
initialize some attributes
imageView = new ImageView(mContext);
imageView.setLayoutParams(new
GridView.LayoutParams(85, 85));
 
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setPadding(8, 8, 8, 8);
} else {
imageView = (ImageView) convertView;
}

imageView.setImageResource(mThumbIds[position]);
return imageView;
}

// references to our images
private Integer[] mThumbIds = {
R.drawable.sample_0, R.drawable.sample_1,
R.drawable.sample_2, R.drawable.sample_3,
R.drawable.sample_4, R.drawable.sample_5,
R.drawable.sample_6, R.drawable.sample_7,
};
}

}

On Mar 11, 10:08 pm, Makas Tzavellas makas.tzavel...@gmail.com
wrote:
 Sounds like you want to use a GridView, create a custom adapter that
 returns an ImageView and set OnItemClickListener to activate your
 desired behaviour.

 You would probably want to take a look at the API Demos that uses
 ListViews for some examples.

 On Mar 11, 5:55 pm, NewDev kna...@gmail.com wrote:

  Hi,

  I want to write an android application, that should have a homepage or
  home screen and having many utilities. Each utility should have an
  icon with the name. So clicking on each utility or the icon, the
  corresponding next screen should be displayed. It should be similar to
  the android home screen. Is there any sample application that i can
  refer? Could anybody please let me know, how to set the icons for the
  utilities in the homepage of my application.

  Thanks in advance,

  NewDev



-- 
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: setting an icon in the application.

2010-03-15 Thread NewDev
Sorry for the previous mail. I got it how to do it :-) Now I am able
to achieve what I wanted it :-)

Thanks again,

On Mar 11, 10:08 pm, Makas Tzavellas makas.tzavel...@gmail.com
wrote:
 Sounds like you want to use a GridView, create a custom adapter that
 returns an ImageView and set OnItemClickListener to activate your
 desired behaviour.

 You would probably want to take a look at the API Demos that uses
 ListViews for some examples.

 On Mar 11, 5:55 pm, NewDev kna...@gmail.com wrote:

  Hi,

  I want to write an android application, that should have a homepage or
  home screen and having many utilities. Each utility should have an
  icon with the name. So clicking on each utility or the icon, the
  corresponding next screen should be displayed. It should be similar to
  the android home screen. Is there any sample application that i can
  refer? Could anybody please let me know, how to set the icons for the
  utilities in the homepage of my application.

  Thanks in advance,

  NewDev



-- 
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: send dtmf

2010-03-15 Thread Mark Murphy
saru wrote:
 Thanks Murphy for ur reply.
 
 I explored ToneGenerator class. Where i m seeing one function
  startTone(int toneType)
 This method starts the playback of a tone of the specified type.
 
 But i need a function like sendDtmf().
 
 Please can you help again???

If you are looking to play DTMF tones over the speaker or headset, use
startTone().

If you are looking to play DTMF tones over the telephony connection
(e.g., to control a voicemail menu), that is not possible in Android.

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

Android App Developer 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] Transparent text over desktop

2010-03-15 Thread Csenteri Barna
Hi

Is there any example or sample how the transparent text over desktop
is achieved by the devtools/Development settings/show running
processes?

I would like to write some text over the desktop like that one from a
service if possible.
The aplication will be for development purposes like the show running
processes but with other data displayed ...

regards,
Brown

-- 
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: Contacts FAQ?

2010-03-15 Thread Berto
Could be intentional.  If it is intentional, it's quite the
oversight.  Although, IIRC, it was coded up, but the code will never
be reached.  Can't remember for sure though.

On Mar 11, 12:36 pm, Jens dunkingbikk...@gmail.com wrote:
 Bug or intentional?

 On 3 mar, 20:31, HCH hayeshau...@gmail.com wrote:

  From my reading of the sources (2.1) a custom account contact is not
  editable on the phone outside of the name fields.

  The contact editor does not read the relevant information out of the
  contacts.xml.  It only reads enough to support what you'd see in the
  Facebook type account.

  The source fix would likely be trivial:  just use the fallback source
  mapping as the baseline.

  On Feb 26, 12:49 am, sazilla sazi...@gmail.com wrote:

   Hi Berto,

   do you managed to render the contacts edit fields from a custom
   account using the native contacts app? or for contacts view only?

   thanks
   Carlo

   On 25 Gen, 17:25, Berto mstbe...@gmail.com wrote:

Just an update for those of you still lost on adding custom accounts,
sync adapters, etc.  I found a great article here:

   http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-1...

Part 2 was the part I needed (how to render the information you synced
to a contact).

HTH,

Berto

On Jan 22, 4:57 pm, Berto mstbe...@gmail.com wrote:

 So, it turns out that anything you put into your own ExternalSource
 will never get parsed and therefore (theoretically) never show up.  Or
 am I doing something wrong?  The code looks like it will parse only
 the information in ContactsDataKind and not the EditField node from
 the following:

 ContactsSource xmlns:android=http://schemas.android.com/apk/res/
 android
     ContactsDataKind
         android:mimeType=com.example.mimetype
         android:icon=@drawable/icon
         android:summaryColumn=data2
         android:detailColumn=data3
         EditField column=data1 title=@string/sample_string /
     /ContactsDataKind
 /ContactsSource

 Essentially, I have adding an account and the sync adapter working.
 But when I try to create a new contact through the contacts app, I can
 never see any of the fields I added in the XML structure defined by
 meta-data android:name=android.provider.CONTACTS_STRUCTURE
 android:resource=@xml/contacts /.  Has anyone figured out an
 answer to this problem yet?  I've seen a few posts, but nothing with a
 solid answer.

 On Jan 12, 4:45 am, Jens dunkingbikk...@gmail.com wrote:

  You could check the Email app - its the current location of the
  Exchange ActiveSync SyncAdapter implementation.

 http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=s...

  Note that this adapter isn't the complete story as any contacts you
  create with your custom accounts will be next to useless without
  looking into the wonky ExternalSource.java integration required for
  custom adapters (unless your happy with contacts that only contains 
  a
  name and photo).

 http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;...

  Sources.java contains the 
  super-special-let's-not-use-our-own-API:s-
  because-that's-hard-work-and-might-require-us-to-actually-document-
  anything-or-heaven-forbid-test-it if-statement that determines the
  layout of your contacts in the Contacts app - and gives 
  super-special
  treatment to accounts with the type com.google or
  com.android.exchange.

  ExternalSource.java contains the sparse and incomplete API
  documentation that you're going to have to use.

  On 9 Jan, 22:16, joebowbeer joe.bowb...@gmail.com wrote:

   On Dec 10 2009, 7:03 am, ydario mc6...@mclink.it wrote:

I tried addingcontactscode to this project

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

   The referenced project no longer exists. Are there any similar
   projects to check out? If not, could someone who has a handle on 
   this
   start anewproject?

-- 
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: General lag issues with real-time games

2010-03-15 Thread snctln
On Mar 14, 8:34 pm, Mark Murphy mmur...@commonsware.com wrote:
 -- On a Google Ion with Android 1.5: the background process running in
 use-the-CPU-mode would steal half the CPU time, about what you would
 expect for all app processes having equivalent priority. For the
 force-the-GC mode, at points when GC was actively cleaning stuff up, it
 would steal 25-75% of the CPU, also fitting expectations, though I was a
 bit surprised as to the severity of some of the spikes.

So is it safe to say that on 1.5 systems GC from other processes
affects performance for all processes?  I know this graph is 3 months
old http://android-developers.blogspot.com/2009/12/knowing-is-half-battle.html
but phones are still being released with 1.5 (the motorola backflip
was just released here in the states last weekend with 1.5 on 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] Re: General lag issues with real-time games

2010-03-15 Thread Mark Murphy
snctln wrote:
 So is it safe to say that on 1.5 systems GC from other processes
 affects performance for all processes?  I know this graph is 3 months
 old http://android-developers.blogspot.com/2009/12/knowing-is-half-battle.html
 but phones are still being released with 1.5 (the motorola backflip
 was just released here in the states last weekend with 1.5 on it).

I suspect so. If you go back in time (insert swirling imagery here) to
last year's tirades about Android and real-time games, foreign process
GC was the leading culprit, and there was solid evidence for it. That's
why they attempted to fix matters in 1.6, and, AFAICT, they succeeded.
And, based on the posts, game developers rejoiced in the new-found
smoothness.

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

Android App Developer Training: http://commonsware.com/training

-- 
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: General lag issues with real-time games

2010-03-15 Thread Dianne Hackborn
On Mon, Mar 15, 2010 at 12:01 AM, Bob Kerns r...@acm.org wrote:

 2) GC tends to touch a lot of memory, which can trigger paging
 activity


Actually I believe that a GC will cause little paging -- the memory that a
GC touches is by definition dirty, so is never a candidate to be swapped out
(since we don't do swapping).  The only paging that could happen is due to
pages with code that has not been used for a long time (maybe finalizers?),
since those are clean mmapped pages so can be dropped from memory if needed.

The bigger impact would be on CPU caches, which on these devices are quite
small.

-- 
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: Which Android device is best, cheapest for 2.1?

2010-03-15 Thread MobDev
Well if you are guessing it might be a complete rewrite you might want
to try the emulator first ?
Just make your software and test it thorough the several emulator-
configurations ?
That might save you money (and time, you can get ahead right away) at
the beginning and it might buy you a couple of months for the next-gen
android phones to get available (HTC Desire/Legend) or even an older
HTC Hero with the new update (to 2.1) which will be coming somewhere
next month...

On 12 mrt, 22:10, DemonDuck kwarner...@verizon.net wrote:
 I will need an Android device (phone, netbook, whatever) eventually.
 I'm a Java programmer and use Eclipse and will be *trying* to develop
 a panorama viewer based on the work I've done on my Java panorama
 viewer --

 http://pancyl.com/BloodMountain.htm

 I understand the Android version will be almost a complete rewrite but
 I would like to have some sort of idea of what capabilities my target
 device should have.  I guess some sort of phone would be a good target
 device but I don't have a clue as to which one or where to get it.  I
 don't particularly want to activate it.  I just want it for
 development purposes.

 GPS is a definite must as is compass and accelerometers.

 Any suggestions about which device(s) I should look at?

-- 
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: Multiple choice in alert dialog

2010-03-15 Thread FrankieCZ
After googling, I found the same problem reported here:

http://code.google.com/p/android/issues/detail?id=2998

Unfortunately, even there is no response from other users or android
developers. Nobody else is facing this problem? I would expect that
multichoice option (with items loaded from the database via Cursor) is
often used in applications

Any idea how to fix it or some work-around to make it 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: General lag issues with real-time games

2010-03-15 Thread snctln


On Mar 15, 9:14 am, Mark Murphy mmur...@commonsware.com wrote:
 snctln wrote:
  So is it safe to say that on 1.5 systems GC from other processes
  affects performance for all processes?  I know this graph is 3 months
  oldhttp://android-developers.blogspot.com/2009/12/knowing-is-half-battle...
  but phones are still being released with 1.5 (the motorola backflip
  was just released here in the states last weekend with 1.5 on it).

 I suspect so. If you go back in time (insert swirling imagery here) to
 last year's tirades about Android and real-time games, foreign process
 GC was the leading culprit, and there was solid evidence for it. That's
 why they attempted to fix matters in 1.6, and, AFAICT, they succeeded.
 And, based on the posts, game developers rejoiced in the new-found
 smoothness.

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

 Android App Developer Training:http://commonsware.com/training


Ahhh, that makes sense.  I might have been part of that tirade of real
time game developers a year ago but around the time 1.6 was released
my Android development took a back seat to my day job (c++ gui stuff)
so I haven't really been caught up.  I can say that the lag problem
is less obvious on my Nexus 1 than on my ADP1, I just assumed it was
due to the faster processor.  I will try to put together some code
this week that just draws some basic shapes moving around a
SurfaceView to see if a simple test case has these problems as well.

-- 
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: setting an icon in the application.

2010-03-15 Thread murali raju
or a simple way would be use compound drawable of  textview.

On Mon, Mar 15, 2010 at 5:31 PM, NewDev kna...@gmail.com wrote:

 Sorry for the previous mail. I got it how to do it :-) Now I am able
 to achieve what I wanted it :-)

 Thanks again,

 On Mar 11, 10:08 pm, Makas Tzavellas makas.tzavel...@gmail.com
 wrote:
  Sounds like you want to use a GridView, create a custom adapter that
  returns an ImageView and set OnItemClickListener to activate your
  desired behaviour.
 
  You would probably want to take a look at the API Demos that uses
  ListViews for some examples.
 
  On Mar 11, 5:55 pm, NewDev kna...@gmail.com wrote:
 
   Hi,
 
   I want to write an android application, that should have a homepage or
   home screen and having many utilities. Each utility should have an
   icon with the name. So clicking on each utility or the icon, the
   corresponding next screen should be displayed. It should be similar to
   the android home screen. Is there any sample application that i can
   refer? Could anybody please let me know, how to set the icons for the
   utilities in the homepage of my application.
 
   Thanks in advance,
 
   NewDev
 
 

 --
 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.comandroid-developers%2bunsubscr...@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] Uncaught exception thrown by finalizer (will be discarded)

2010-03-15 Thread creativepragmatic
Hello,

The following function throws the exception Uncaught exception thrown
by finalizer (will be discarded): Ljava/lang/IllegalStateException;:
Finalizing cursor android.database.sqlite.sqlitecur...@437b64a8 on
Stores that has not been deactivated or closed.


private void generateList() {

try {
listCursor = dbHelper.generateList(bundle.getString(STORE),
bundle.getString(PERCENT));

if(listCursor.moveToFirst())
do {
Integer quantity = listCursor.getInt(0);
String itemName = listCursor.getString(1);

ListItem listItem = new ListItem(listId, 
itemName, quantity,
false);

dbHelper.insertItem(listItem);
alItems.add(listItem);
} while(listCursor.moveToNext());
} catch(Exception ex) {
ex.printStackTrace();
} finally {
if(!listCursor.isClosed() || listCursor != null) {
listCursor.deactivate();
listCursor.close();
}
}

iaList.notifyDataSetChanged();
}


The exception is usually thrown after the third time the function has
been called.  LogCat shows the exception in green (Info) and does not
seem to affect performance of the app when running on ADP2 after it
has been disconnected.  When the line with alItems.add(listItem) is
not commented out, the exception is not thrown.  I am using Android
1.5.

Has anyone experience anything similar?

-- 
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] Periodic VerifyError on Android 1.5 related to GeoPoint in signature

2010-03-15 Thread Tim
I developed the gig guide application Alice, but I have run into a
problem I haven't been able to solve...

A bunch of users with Android 1.5 are reporting Force Closes because
of Verify Errors.

I have a LocationHelper class which has GeoPoint in one of its method
signatures. When I instantiate this class, a VerifyError is thrown.
The weird thing is seems to be very rarely thrown. I saw it only once
on my HTC Hero. I am unable to reproduce it, but I know that a lot of
my 1.5 users get this problem.

Problem Class

public class LocationHelper implements LocationListener {

public static final double RADIUS_KILOMETERS = 6378;
public static final double RADIUS_MILES = 3963;

private static LocationHelper instance;
private GeoPoint myGeoPoint;

public static LocationHelper getInstance(Context context) {
if (instance == null) {
instance = new LocationHelper(context);
}
return instance;
}

public static double calculationByDistance(GeoPoint StartP, GeoPoint
EndP, double radius) {
double lat1 = StartP.getLatitudeE6() / 1E6;
double lat2 = EndP.getLatitudeE6() / 1E6;
double lon1 = StartP.getLongitudeE6() / 1E6;
double lon2 = EndP.getLongitudeE6() / 1E6;
double dLat = Math.toRadians(lat2 - lat1);
double dLon = Math.toRadians(lon2 - lon1);
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(Math.toRadians(lat1))
* Math.cos(Math.toRadians(lat2)) * 
Math.sin(dLon / 2) *
Math.sin(dLon / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return radius * c;
}

...

}

The class which calls the LocationHelper uses this code, and this is
where the VerifyError is thrown:

LocationHelper helper = LocationHelper.getInstance(context);


Extract from the manifest file:

uses-library
android:name=com.google.android.maps /

uses-sdk
android:minSdkVersion=3
android:targetSdkVersion=4 /

Stack trace

03-12 04:28:09.295 I/ActivityManager(   67): Displayed activity
com.android.vending/.AssetInfoActivity: 405 ms
03-12 04:28:25.845 I/ActivityManager(   67): Start proc com.citc.alice
for broadcast com.citc.alice/.EventAlarmReceiver: pid=9508 uid=10051
gids={3003}
03-12 04:28:27.135 W/dalvikvm( 9508): VFY: unable to find class
referenced in signature (Lcom/google/android/maps/GeoPoint;)
03-12 04:28:27.135 W/dalvikvm( 9508): VFY: unable to find class
referenced in signature (Lcom/google/android/maps/GeoPoint;)
03-12 04:28:27.165 W/dalvikvm( 9508): VFY: unable to find class
referenced in signature (Lcom/google/android/maps/GeoPoint;)
03-12 04:28:27.165 E/dalvikvm( 9508): Could not find method
com.google.android.maps.GeoPoint.getLatitudeE6, referenced from method
com.citc.alice.util.LocationHelper.calculationByDistance
03-12 04:28:27.165 W/dalvikvm( 9508): VFY: unable to resolve virtual
method 1259: Lcom/google/android/maps/GeoPoint;.getLatitudeE6 ()I
03-12 04:28:27.165 W/dalvikvm( 9508): VFY:  rejecting opcode 0x6e at
0x
03-12 04:28:27.165 W/dalvikvm( 9508): VFY:  rejected Lcom/citc/alice/
util/LocationHelper;.calculationByDistance (Lcom/google/android/maps/
GeoPoint;Lcom/google/android/maps/GeoPoint;D)D
03-12 04:28:27.165 W/dalvikvm( 9508): Verifier rejected class Lcom/
citc/alice/util/LocationHelper;
03-12 04:28:27.175 D/AndroidRuntime( 9508): Shutting down VM
03-12 04:28:27.175 W/dalvikvm( 9508): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
03-12 04:28:27.175 E/AndroidRuntime( 9508): Uncaught handler: thread
main exiting due to uncaught exception
03-12 04:28:27.225 E/AndroidRuntime( 9508): java.lang.VerifyError:
com.citc.alice.util.LocationHelper
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
com.citc.alice.AliceApplication.onCreate(AliceApplication.java:20)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:
1048)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:
3622)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.app.ActivityThread.access$2500(ActivityThread.java:112)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1729)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.os.Handler.dispatchMessage(Handler.java:99)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.os.Looper.loop(Looper.java:123)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
android.app.ActivityThread.main(ActivityThread.java:3948)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
java.lang.reflect.Method.invokeNative(Native Method)
03-12 04:28:27.225 E/AndroidRuntime( 9508): at
java.lang.reflect.Method.invoke(Method.java:521)
03-12 04:28:27.225 E/AndroidRuntime( 9508): 

[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-15 Thread ani
It is the problem with your driver which creates this chopping
effect.It is not able to read the data properly and if you check your
kernel messages there would be a buffer overrun message.This happens
because Linux is not RTOS and audio is running in real time.

What you are recording is noise also along with voice data.So you need
noise cancellation algorithm also if you want proper sound.

There is one more problem with respect to sampling rate.If your driver
supports x sampling rate and you want to sample at y sampling rate
then there is resampling that takes place which causes some loss in
data.So your re-sampler also should be good enough to do re-sampling.

Generally audio re-samplers provided by android is not of good quality
and if you do playback and recording simultaneously then you can make
out that playback is not proper(there would be some audio distortion
in your playback audio).

-- 
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: General lag issues with real-time games

2010-03-15 Thread Dianne Hackborn
On Mon, Mar 15, 2010 at 6:14 AM, Mark Murphy mmur...@commonsware.comwrote:

 snctln wrote:
  So is it safe to say that on 1.5 systems GC from other processes
  affects performance for all processes?  I know this graph is 3 months
  old
 http://android-developers.blogspot.com/2009/12/knowing-is-half-battle.html
  but phones are still being released with 1.5 (the motorola backflip
  was just released here in the states last weekend with 1.5 on it).
 I suspect so. If you go back in time (insert swirling imagery here) to
 last year's tirades about Android and real-time games, foreign process
 GC was the leading culprit, and there was solid evidence for it. That's
 why they attempted to fix matters in 1.6, and, AFAICT, they succeeded.
 And, based on the posts, game developers rejoiced in the new-found
 smoothness.


Yeah it is nice to see this generally working as intended. :)  Interruption
from background processes is a general issue that we'd like to address for
the overall platform, regardless of games -- it is a negative for any
foreground application, including its basic responsiveness as well as
smoothness of animations etc.

Even with that, though, there are some things that can allow other
applications to get in the way:

- Any application can use setForeground() to no longer run in the background
scheduling class.  This is one of the reasons why as of 2.0 such apps must
post a notification to go along with this state, so the user is aware of it
and has a clear way to get rid of it.

- When we are in the process of delivering a broadcast we may bring the
application out of the background class, so we do not need to wait a long
time for it to complete.  (Broadcasts have up to 10 seconds to complete; it
is very undesirable to let them take longer, as that can block up other
important things driven off of broadcasts).

- Likewise services are raised out of background when delivering create,
start, and destroy operations.  This is done for the same reason, to avoid
timeouts.

I expect we will do further work on the latter points (for example perhaps
having separate broadcast queues for things that should be foreground vs.
background), but I'm not sure when such things will be done.

-- 
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: Device Seeding Program for Top Android Market Developers

2010-03-15 Thread f_heft
I just received my Nexus One via FedEx - thank you, Google! :)

Btw: No special branding or anything on the phone itself , it's
exactly like the one you can buy :)
And I got mine from the Netherlands (I'm living in Germany) and it was
shipped on March 12th (for those of you who are still waiting).


On 3 Mrz., 00:53, Larry lar...@gmail.com wrote:
 Dear all,

 I just received an email about Device Seeding Program for Top Android
 Market Developers:

 Subject: Device Seeding Program for Top Android Market Developers
 From: android-market-seed...@google.com

 Due to your contribution to the success of Android Market, we would
 like to present you with a brand new Android device as part of our
 developer device seeding program. You are receiving this message
 because you're one of the top developers in Android Market with one or
 more of your applications having a 3.5 star or higher rating and more
 than 5,000 unique downloads.

 In order to receive this device, you must click through to this site,
 read the terms and conditions of the offer and fill out the
 registration form to give us your current mailing address so that we
 can ship your device.

 You will receive either a Verizon Droid by Motorola or a Nexus One.
 Developers with mailing addresses in the US will receive either a
 Droid or Nexus one, based on random distribution. Developers from
 Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland,
 Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers
 with mailing addresses in countries not listed above will not receive
 a phone since these phones are not certified to be used in other
 countries.

 We hope that you will enjoy your new device and continue to build more
 insanely popular apps for Android!

 The email is from Google but I am still doubting somehow. Is this a
 spam? Any other developers receive this emails before?

 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


Re: [android-developers] Getting contacts when ids are known

2010-03-15 Thread Dmitri Plotnikov
Cursor c = query(Contacts.CONTENT_URI,...,_id IN (12,24,35),null,...)

You will need to use a StringBuilder to construct the selection out of
contact ids.

Cheers,
Dmitri

On Mar 15, 2010 3:19 AM, Pankaj pankajiit...@gmail.com wrote:

Hi,

I have a list of 'n' contact ids corresponding to which I need to
obtain the contact details. One simple way to make n queries using the
contact ids and retrieve those contacts. But this will be very time-
consuming especially if n is large. I would like to know if there is
any simpler way to obtain these results (like batch query etc).

--
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.comandroid-developers%2bunsubscr...@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] In which case should i use content provider?

2010-03-15 Thread Vincent Tsao
hi there, how should i use content provider without share app data between
other app?

-- 
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] 3D Physics Engine For Android Demo

2010-03-15 Thread Kevin S.
   I've completed my first Android application.   It as 3D demo with a
physics engine.   It uses the phone's accelerometer so that you can
shake the world by moving the phone around.   There are  options to
adjust things like gravity, friction, and elasticity.

  The physics engine is a 100% Java port of the open source JigLib
physics engine.

  However, I only have a Motorola Droid, and I don't know if it will
work on any other phone.   The project is set to use Android 1.6.

  Before I put it in the market, I was hoping to get some feedback
from the developer community here.

  If anybody is interested in 3D stuff or physics simulation, you can
give the app a try.   The link is on the follow page.   There is a
screen shot there so you can get an idea of what the app is.

http://www.pieintheskysoftware.com/menuitem-resources-pie-3d-physics-1-0.html

-Kevin

-- 
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] Petition: Google, please improve the Android Market.

2010-03-15 Thread Greg Donald
On Sun, Mar 14, 2010 at 7:45 AM, Rob Irondad rob.iron...@gmail.com wrote:
 As of now it has been signed by almost 1000 people.

#966 here.

One thing, please add a mention about the lack of landscape oriented
screenshots.  I've yet to build anything portrait oriented, so every
one of my Marketplace listings is affected by their lack of foresight.

Thanks,

-- 
Greg Donald
destiney.com | gregdonald.com

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


[android-developers] Re: 3D Physics Engine For Android Demo

2010-03-15 Thread Streets Of Boston
Works pretty well on my Nexus One. I get about 30 - 35 frames a
second.

On Mar 15, 10:25 am, Kevin S. dada...@gmail.com wrote:
    I've completed my first Android application.   It as 3D demo with a
 physics engine.   It uses the phone's accelerometer so that you can
 shake the world by moving the phone around.   There are  options to
 adjust things like gravity, friction, and elasticity.

   The physics engine is a 100% Java port of the open source JigLib
 physics engine.

   However, I only have a Motorola Droid, and I don't know if it will
 work on any other phone.   The project is set to use Android 1.6.

   Before I put it in the market, I was hoping to get some feedback
 from the developer community here.

   If anybody is interested in 3D stuff or physics simulation, you can
 give the app a try.   The link is on the follow page.   There is a
 screen shot there so you can get an idea of what the app is.

 http://www.pieintheskysoftware.com/menuitem-resources-pie-3d-physics-...

 -Kevin

-- 
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] 3D Physics Engine For Android Demo

2010-03-15 Thread Marc Lester Tan
Works well on my Nexus One. Cool!

On Mon, Mar 15, 2010 at 10:25 PM, Kevin S. dada...@gmail.com wrote:

   I've completed my first Android application.   It as 3D demo with a
 physics engine.   It uses the phone's accelerometer so that you can
 shake the world by moving the phone around.   There are  options to
 adjust things like gravity, friction, and elasticity.

  The physics engine is a 100% Java port of the open source JigLib
 physics engine.

  However, I only have a Motorola Droid, and I don't know if it will
 work on any other phone.   The project is set to use Android 1.6.

  Before I put it in the market, I was hoping to get some feedback
 from the developer community here.

  If anybody is interested in 3D stuff or physics simulation, you can
 give the app a try.   The link is on the follow page.   There is a
 screen shot there so you can get an idea of what the app is.


 http://www.pieintheskysoftware.com/menuitem-resources-pie-3d-physics-1-0.html

 -Kevin

 --
 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.comandroid-developers%2bunsubscr...@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: 3D Physics Engine For Android Demo

2010-03-15 Thread Mario Zechner
Tried it on my Milestone. Pretty neat. The fps degrade to around 12-15
after some time (essentially when the big plate starts to touch the
ground completely) probably due to there being a lot more contact
points then. Also, the garbage collector is getting a fair amount of
work to do every 5 seconds or so. I don't know much about JigLib but
maybe you could make it so that it uses JStackAlloc. JBullet uses that
library and has no garbage collection at all. I put together a simple
JBullet demo a while back, you can find information on that at
http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=81. I do not
recommend using a pure Java based physics library at this point for a
full featured game unless the scene is really really simple. Consider
using bullet via the NDK.

You get extra points for implementing the activity life cycle
correctly :)

On 15 Mrz., 15:43, Marc Lester Tan mail...@gmail.com wrote:
 Works well on my Nexus One. Cool!

 On Mon, Mar 15, 2010 at 10:25 PM, Kevin S. dada...@gmail.com wrote:
    I've completed my first Android application.   It as 3D demo with a
  physics engine.   It uses the phone's accelerometer so that you can
  shake the world by moving the phone around.   There are  options to
  adjust things like gravity, friction, and elasticity.

   The physics engine is a 100% Java port of the open source JigLib
  physics engine.

   However, I only have a Motorola Droid, and I don't know if it will
  work on any other phone.   The project is set to use Android 1.6.

   Before I put it in the market, I was hoping to get some feedback
  from the developer community here.

   If anybody is interested in 3D stuff or physics simulation, you can
  give the app a try.   The link is on the follow page.   There is a
  screen shot there so you can get an idea of what the app is.

 http://www.pieintheskysoftware.com/menuitem-resources-pie-3d-physics-...

  -Kevin

  --
  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.comandroid-developers%2bunsubscr...@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] Android Market Problem - cannot find my free app in the market

2010-03-15 Thread BlackLight
Hello.

I've got several messages from my users that they cannot download my
app. My app should be available in any market from sdk 1.5 and up, but
it's not. Can someone help me with it? Why only part of users with sdk
1.6 can find my app? Should I add android:targetSdkVersion?

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.someapp
  android:versionCode=1
  android:versionName=1.0

uses-sdk android:minSdkVersion=3 /

uses-permission android:name=android.permission.VIBRATE /
uses-permission android:name=android.permission.RECORD_AUDIO /
uses-permission
android:name=android.permission.READ_PHONE_STATE /
uses-permission android:name=android.permission.INTERNET /
uses-permission android:name=android.permission.WAKE_LOCK /

application android:icon=@drawable/icon android:label=@string/
app_name
...

Is something wrong with AndroidManifest.xml?

P.S. If I need to use other forum, please, give me the link. 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: Android Market Problem - cannot find my free app in the market

2010-03-15 Thread Streets Of Boston
What's the name of your app (the name as it would appear on the
Android Market)?

On Mar 15, 10:51 am, BlackLight blacklight1...@gmail.com wrote:
 Hello.

 I've got several messages from my users that they cannot download my
 app. My app should be available in any market from sdk 1.5 and up, but
 it's not. Can someone help me with it? Why only part of users with sdk
 1.6 can find my app? Should I add android:targetSdkVersion?

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
       package=com.someapp
       android:versionCode=1
       android:versionName=1.0

     uses-sdk android:minSdkVersion=3 /

     uses-permission android:name=android.permission.VIBRATE /
     uses-permission android:name=android.permission.RECORD_AUDIO /
     uses-permission
 android:name=android.permission.READ_PHONE_STATE /
     uses-permission android:name=android.permission.INTERNET /
     uses-permission android:name=android.permission.WAKE_LOCK /

     application android:icon=@drawable/icon android:label=@string/
 app_name
 ...

 Is something wrong with AndroidManifest.xml?

 P.S. If I need to use other forum, please, give me the link. 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: Audio Flickering - my code, my computer or android emulator?

2010-03-15 Thread Gabriel Simões
Thanks for your answers ...

Well, since the same source code works on your computer and not on
mine, I think the chopping problem is on my emulator. My computer is
not as good as yours but it´s a Turion X2 notebook with 2gb ram, so if
on a computer like this the emulator is not able to record and
playback audio at the same time, even not fast enought to handle the
audio stream before AudioRecord warns a buffer overflow, then I really
don´t know what to try next.
I hope I can find a phone to try the app in a real device. Also, I
will try the sdk 1.6.

About ani´s post, I do understand it, but I´m using Windows XP SP3.
Also, I believe that if the emulator accepts 8k as record and playback
sample rate (it doesn´t accept any othet value) then it should work
properly for recording and playing the same audio stream in this SR. It
´s not the best option but if there´s a need for manual ressampling,
it can be done. What can´t is the action of properly recording audio.

Anyone else facing this same problem on SDK 2.1, AMD processor,
windows xp sp3?

On 15 mar, 11:17, ani anish198519851...@gmail.com wrote:
 It is the problem with your driver which creates this chopping
 effect.It is not able to read the data properly and if you check your
 kernel messages there would be a buffer overrun message.This happens
 because Linux is not RTOS and audio is running in real time.

 What you are recording is noise also along with voice data.So you need
 noise cancellation algorithm also if you want proper sound.

 There is one more problem with respect to sampling rate.If your driver
 supports x sampling rate and you want to sample at y sampling rate
 then there is resampling that takes place which causes some loss in
 data.So your re-sampler also should be good enough to do re-sampling.

 Generally audio re-samplers provided by android is not of good quality
 and if you do playback and recording simultaneously then you can make
 out that playback is not proper(there would be some audio distortion
 in your playback audio).

-- 
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] Transparent text over desktop

2010-03-15 Thread Romain Guy
Hi,

This is done by the system, regular applications cannot do this.

On Mon, Mar 15, 2010 at 4:28 AM, Csenteri Barna br...@mini-box.com wrote:
 Hi

 Is there any example or sample how the transparent text over desktop
 is achieved by the devtools/Development settings/show running
 processes?

 I would like to write some text over the desktop like that one from a
 service if possible.
 The aplication will be for development purposes like the show running
 processes but with other data displayed ...

 regards,
 Brown

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




-- 
Romain Guy
Android framework engineer
romain...@android.com

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

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


[android-developers] Re: Audio Flickering - my code, my computer or android emulator?

2010-03-15 Thread Gabriel Simões
Thanks for your answers ...

Well, since the same source code works on your computer and not on
mine, I think the chopping problem is on my emulator. My computer is
not as good as yours but it´s a Turion X2 notebook with 2gb ram, so
if
on a computer like this the emulator is not able to record and
playback audio at the same time, even not fast enought to handle the
audio stream before AudioRecord warns a buffer overflow, then I
really
don´t know what to try next.
I hope I can find a phone to try the app in a real device. Also, I
will try the sdk 1.6.


About ani´s post, I do understand it, but I´m using Windows XP SP3 and
Android runs as linux but the API works for other people so this
shouldn´t be an OS flaw.
Also, I believe that if the emulator accepts 8k as record and
playback
sample rate (it doesn´t accept any othet value) then it should work
properly for recording and playing the same audio stream in this SR.
It
´s not the best option but if there´s a need for manual
ressampling,
it can be done. What can´t is the action of properly recording audio.


Anyone else facing this same problem on SDK 2.1, AMD processor,
windows xp sp3?


On 15 mar, 11:17, ani anish198519851...@gmail.com wrote:
 It is the problem with your driver which creates this chopping
 effect.It is not able to read the data properly and if you check your
 kernel messages there would be a buffer overrun message.This happens
 because Linux is not RTOS and audio is running in real time.

 What you are recording is noise also along with voice data.So you need
 noise cancellation algorithm also if you want proper sound.

 There is one more problem with respect to sampling rate.If your driver
 supports x sampling rate and you want to sample at y sampling rate
 then there is resampling that takes place which causes some loss in
 data.So your re-sampler also should be good enough to do re-sampling.

 Generally audio re-samplers provided by android is not of good quality
 and if you do playback and recording simultaneously then you can make
 out that playback is not proper(there would be some audio distortion
 in your playback audio).

-- 
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: Device Seeding Program for Top Android Market Developers

2010-03-15 Thread Bradley Stacey
When did you receive your shipping email?

On 15 March 2010 14:19, f_heft delphik...@gmail.com wrote:
 I just received my Nexus One via FedEx - thank you, Google! :)

 Btw: No special branding or anything on the phone itself , it's
 exactly like the one you can buy :)
 And I got mine from the Netherlands (I'm living in Germany) and it was
 shipped on March 12th (for those of you who are still waiting).


 On 3 Mrz., 00:53, Larry lar...@gmail.com wrote:
 Dear all,

 I just received an email about Device Seeding Program for Top Android
 Market Developers:

 Subject: Device Seeding Program for Top Android Market Developers
 From: android-market-seed...@google.com

 Due to your contribution to the success of Android Market, we would
 like to present you with a brand new Android device as part of our
 developer device seeding program. You are receiving this message
 because you're one of the top developers in Android Market with one or
 more of your applications having a 3.5 star or higher rating and more
 than 5,000 unique downloads.

 In order to receive this device, you must click through to this site,
 read the terms and conditions of the offer and fill out the
 registration form to give us your current mailing address so that we
 can ship your device.

 You will receive either a Verizon Droid by Motorola or a Nexus One.
 Developers with mailing addresses in the US will receive either a
 Droid or Nexus one, based on random distribution. Developers from
 Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland,
 Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers
 with mailing addresses in countries not listed above will not receive
 a phone since these phones are not certified to be used in other
 countries.

 We hope that you will enjoy your new device and continue to build more
 insanely popular apps for Android!

 The email is from Google but I am still doubting somehow. Is this a
 spam? Any other developers receive this emails before?

 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

-- 
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_ID always null on devices

2010-03-15 Thread Guillaume Perrot
Yeah but what about devices without WIFI ?

On 3 fév, 16:26, Gregg Reno gregg.r...@gmail.com wrote:
 How about using the WIFI MAC address in cases where the ANDROID_ID is
 null?  I believe it should be unique for each device:

         WifiManager manager = (WifiManager) getSystemService
 (Context.WIFI_SERVICE);
         WifiInfo wifiInfo = manager.getConnectionInfo();
         String MACAddress = wifiInfo.getMacAddress();

 This seems to pull back a MAC address even if WIFI is turned off.

 -Gregg

 On Feb 1, 10:54 am, Rampanda khaeonga...@gmail.com wrote:

  Hi,

  having the exact same problem on a Droid 2.0.1 and HTC Hero 1.5. :

          String androidID = Secure.getString(this.getContextResolver(),
  android.provider.Settings.Secure.ANDROID_ID);
          Toast.makeText(this, ANDROID_ID:  + androidID,
  Toast.LENGTH_LONG).show();

  consistently returns null on the devices and differences in OS and
  device seem to indicate some sort of problem with the compiled code.

  Not sure what is causing this, could be that the app erroneously
  believes it is running on an emulator or for some other reason is
  unable to retrieve the setting.

  No uncaught exceptions or other error message are printed when making
  these calls which help.

  For our application to work we need to be 100% sure we have a unique
  ID across all OS versions and device manufacturers, which is exactly
  what androidID is for. We're using IMEI and some key voodoo to sort of
  make it unique, but would prefer androidID to work. Also, it not
  working may be caused by something else that is also breaking other
  functionality.

  Haven't found the cause yet, but as soon as something falls into place
  I'll post it here. In the meantime, what is the name of the android
  apps you're using? Would like to test with the exact same ones you're
  testing on.

  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


Re: [android-developers] Re: What is exactly an ANDROID_ID ?

2010-03-15 Thread Guillaume Perrot
In my job, I have to use a unique device ID that is not the IMEI or any
other info provided by the TelephonyManager (for some privacy reasons) so I
would like to rely on ANDROID_ID.
But people I work for don't trust the ANDROID_ID because they don't know
exactly what it is and we don't have the guarantee that it's globally unique
(since this is set only by device manufacturers' will).
Anyone have any idea on how these IDs are built ? I need more info to
convince them to use that damn id...

2010/2/12 jotobjects jotobje...@gmail.com

 Too bad it is NOT documented.  There was a long thread about this
 recently and one poster even thought it had something to do with
 connecting to the Market.   Seems like some developers are looking for
 workarounds for a viable unique ID.  Probably most of this is due to
 misunderstanding which is due to lack of documentation of course.

 http://groups.google.com/group/android-developers/msg/42aceb303e8b42f6

 On Feb 12, 5:16 am, Guillaume Perrot guillaume.p...@gmail.com wrote:
Is it related to
google apps ?
 
   Not that I am aware of.
 
  I asked this question since we can read in the doc: Identical to that
  obtained by calling GoogleLoginService.getAndroidId(); which sounds
  strange. Spoofing android_id could grant access to the Google account
  of someone else ?

 --
 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.comandroid-developers%2bunsubscr...@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] Re: What is exactly an ANDROID_ID ?

2010-03-15 Thread Mark Murphy
Guillaume Perrot wrote:
 In my job, I have to use a unique device ID that is not the IMEI or any
 other info provided by the TelephonyManager (for some privacy reasons)
 so I would like to rely on ANDROID_ID.
 But people I work for don't trust the ANDROID_ID because they don't know
 exactly what it is and we don't have the guarantee that it's globally
 unique (since this is set only by device manufacturers' will).
 Anyone have any idea on how these IDs are built ? I need more info to
 convince them to use that damn id...

Bear in mind that this ID is stored in a SQLite database and can be
modified on rooted phones.

Also bear in mind that there is only modest coordination on ANDROID_ID.
For example, ARCHOS shipped their first Internet table where the
ANDROID_ID value did not correspond to the API documentation (wasn't a
hex string). This may be because they do not have the Android Market,
and so get to invent their own strings. Reputedly, the ANDROID_ID value
comes from the Market on first use.

ANDROID_ID is fine for casual use, but it's not exactly the Rock of
Gibraltar, if you know what I mean.

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

_Beginning Android_ from Apress Now Available!

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


[android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread webmonkey
For your storePicture function it is better to run the MediaScanner to
add an image file to the MediaStore, see

http://developer.android.com/reference/android/media/MediaScannerConnection.html

Just create a MediaScannerConnection, provide a
MediaScannerConnectionClient, and scan the file. The
MediaScannerConnectionClient will give you the Uri in onScanCompleted.

You can also use the MediaScanner in the getContentUriFromFile
function. If should give you the Uri that already exists for the file,
if not, it will add it automatically.

It is much more future proof than adding an image manually using the
MediaStore database.


On Mar 15, 12:47 am, Nivek kevin.gau...@gmail.com wrote:
 You can use Astro File Manager or Estrongs File Explorer to backup the
 Photoshop app on your sdcard.

 Then, transfer the apk on your computer and install it on a running
 emulator using adb.

 adb install Photoshop.apk

 Now, I implemented a workaround for the problem I detected before:
 Photoshop can't edit its own results.

 Actually, I found out that Photoshop was storing its result in
 MediaStore, so it should have been able to send its result as a content://
 uri since MediaStore gives one !

 My workaround is to search in the MediaStore for the picture saved by
 Photoshop. I use the fact that MediaStore stores the path of images in
 their DATA column.

 Here is the code 
 :http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...

 Here is the call when receiving Photoshop's 
 result:http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...

 Kevin

 On 13 mar, 15:59, nayana urs nayana...@gmail.com wrote:



  can we test this feature in emulator
  with regards
     Nayana

  On Fri, Mar 12, 2010 at 6:18 PM, Nivek kevin.gau...@gmail.com wrote:
They could have added the result to the MediaStore and returned that
uri... I'll have to do it myself or my edit button disappears after
editing a picture...

   Actually, this is what I will have to do as a workaround, but I can't
   see any reason why they shouldn't accept a file:// uri as an input !

   Kevin

   On 13 mar, 03:10, Nivek kevin.gau...@gmail.com wrote:
There is an inconsistency in their Uri handling... The app accepts
only content:// Uris but provides the result as a file:// Uri... so it
can't edit it's own result again without us having to work this
around...

They could have added the result to the MediaStore and returned that
uri... I'll have to do it myself or my edit button disappears after
editing a picture...

I think Adobe should fix this.

Kevin

On 11 mar, 16:43, webmonkey webmonke...@gmail.com wrote:

 The document provided by Adobe does not mention how you should read
 the returned Uri. For compatibility with future versions and other
 image editors, you should not assume that it is a 'file:' scheme Uri,
 it could also be a 'content:' scheme Uri. The ContentResolver will
 handle it. here is the code:

 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent
 data)
 {
     super.onActivityResult(requestCode, resultCode, data);
     if (requestCode == LAUNCH_EDITOR)
     {
         if (resultCode == Activity.RESULT_OK)
         {
             Uri savedImage = data.getData();
             // savedImage is the Uri for the newly created
             // edited version of the original image.

             ContentResolver cr = getContentResolver();

             InputStream in = null;
             try {
                  in = cr.openInputStream(savedImage);
                  // you now have an InputStream to the saved image
                  // you can copy it by saving to an OutputStream
                  // or you can load it as a Bitmap
                  Bitmap bitmap = BitmapFactory.decodeStream(in);

             } catch (IOException e)
             {
             }
         }
         else
         {
             // Edit Operation canceled by user
         }
     }

 }

 On Mar 5, 9:10 pm, Adobe DI Mobile mobilead...@gmail.com wrote:

  ThePhotoshop.com Mobile editor is now available to the Android
  developer community as an activity that handles actions of type
  Intent.ACTION_EDIT, for image content that has data of mime-type
   image/
  *.

  For more information on incorporating the editor into your Android
  application, please visit:
  http://mobile.photoshop.com/android/developers.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.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group at
  

Re: [android-developers] Re: What is exactly an ANDROID_ID ?

2010-03-15 Thread Guillaume Perrot
I guess we'll have to use some hashing technique of many values like
explained on another thread, but I don't like this solution...
Thanks for the answer anyway.

2010/3/15 Mark Murphy mmur...@commonsware.com

 Guillaume Perrot wrote:
  In my job, I have to use a unique device ID that is not the IMEI or any
  other info provided by the TelephonyManager (for some privacy reasons)
  so I would like to rely on ANDROID_ID.
  But people I work for don't trust the ANDROID_ID because they don't know
  exactly what it is and we don't have the guarantee that it's globally
  unique (since this is set only by device manufacturers' will).
  Anyone have any idea on how these IDs are built ? I need more info to
  convince them to use that damn id...

 Bear in mind that this ID is stored in a SQLite database and can be
 modified on rooted phones.

 Also bear in mind that there is only modest coordination on ANDROID_ID.
 For example, ARCHOS shipped their first Internet table where the
 ANDROID_ID value did not correspond to the API documentation (wasn't a
 hex string). This may be because they do not have the Android Market,
 and so get to invent their own strings. Reputedly, the ANDROID_ID value
 comes from the Market on first use.

 ANDROID_ID is fine for casual use, but it's not exactly the Rock of
 Gibraltar, if you know what I mean.

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

 _Beginning Android_ from Apress Now 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.comandroid-developers%2bunsubscr...@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] Re: What is exactly an ANDROID_ID ?

2010-03-15 Thread Greg Donald
On Mon, Mar 15, 2010 at 10:48 AM, Mark Murphy mmur...@commonsware.com wrote:
 ANDROID_ID is fine for casual use, but it's not exactly the Rock of
 Gibraltar, if you know what I mean.

I can't think of a scenario where I would ever need it casually.
Either I need it or I don't.


-- 
Greg Donald
destiney.com | gregdonald.com

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


[android-developers] Re: Device Seeding Program for Top Android Market Developers

2010-03-15 Thread Thomas Riley
Awesome! Enjoy! Time to go make some cool Android 2.x apps my
friend! ;)

Out of interest, did you receive a shipping email? Or just the
confirmation email from google?

Also, any idea who it was shipped from? ie, Brightstar?

On Mar 15, 2:19 pm, f_heft delphik...@gmail.com wrote:
 I just received my Nexus One via FedEx - thank you, Google! :)

 Btw: No special branding or anything on the phone itself , it's
 exactly like the one you can buy :)
 And I got mine from the Netherlands (I'm living in Germany) and it was
 shipped on March 12th (for those of you who are still waiting).

 On 3 Mrz., 00:53, Larry lar...@gmail.com wrote:



  Dear all,

  I just received an email about Device Seeding Program for Top Android
  Market Developers:

  Subject: Device Seeding Program for Top Android Market Developers
  From: android-market-seed...@google.com

  Due to your contribution to the success of Android Market, we would
  like to present you with a brand new Android device as part of our
  developer device seeding program. You are receiving this message
  because you're one of the top developers in Android Market with one or
  more of your applications having a 3.5 star or higher rating and more
  than 5,000 unique downloads.

  In order to receive this device, you must click through to this site,
  read the terms and conditions of the offer and fill out the
  registration form to give us your current mailing address so that we
  can ship your device.

  You will receive either a Verizon Droid by Motorola or a Nexus One.
  Developers with mailing addresses in the US will receive either a
  Droid or Nexus one, based on random distribution. Developers from
  Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland,
  Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers
  with mailing addresses in countries not listed above will not receive
  a phone since these phones are not certified to be used in other
  countries.

  We hope that you will enjoy your new device and continue to build more
  insanely popular apps for Android!

  The email is from Google but I am still doubting somehow. Is this a
  spam? Any other developers receive this emails before?

  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: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread webmonkey
There is also a bug in PS mobile, and one more reason why you should
not assume anything about the resulting intent data. When you send a
PNG file for editing, PS returns a file with the PNG extension but it
is actually a JPEG.

On Mar 15, 4:54 pm, webmonkey webmonke...@gmail.com wrote:
 For your storePicture function it is better to run the MediaScanner to
 add an image file to the MediaStore, see

 http://developer.android.com/reference/android/media/MediaScannerConn...

 Just create a MediaScannerConnection, provide a
 MediaScannerConnectionClient, and scan the file. The
 MediaScannerConnectionClient will give you the Uri in onScanCompleted.

 You can also use the MediaScanner in the getContentUriFromFile
 function. If should give you the Uri that already exists for the file,
 if not, it will add it automatically.

 It is much more future proof than adding an image manually using the
 MediaStore database.

 On Mar 15, 12:47 am, Nivek kevin.gau...@gmail.com wrote:



  You can use Astro File Manager or Estrongs File Explorer to backup the
  Photoshop app on your sdcard.

  Then, transfer the apk on your computer and install it on a running
  emulator using adb.

  adb install Photoshop.apk

  Now, I implemented a workaround for the problem I detected before:
  Photoshop can't edit its own results.

  Actually, I found out that Photoshop was storing its result in
  MediaStore, so it should have been able to send its result as a content://
  uri since MediaStore gives one !

  My workaround is to search in the MediaStore for the picture saved by
  Photoshop. I use the fact that MediaStore stores the path of images in
  their DATA column.

  Here is the code 
  :http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...

  Here is the call when receiving Photoshop's 
  result:http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...

  Kevin

  On 13 mar, 15:59, nayana urs nayana...@gmail.com wrote:

   can we test this feature in emulator
   with regards
      Nayana

   On Fri, Mar 12, 2010 at 6:18 PM, Nivek kevin.gau...@gmail.com wrote:
 They could have added the result to the MediaStore and returned that
 uri... I'll have to do it myself or my edit button disappears after
 editing a picture...

Actually, this is what I will have to do as a workaround, but I can't
see any reason why they shouldn't accept a file:// uri as an input !

Kevin

On 13 mar, 03:10, Nivek kevin.gau...@gmail.com wrote:
 There is an inconsistency in their Uri handling... The app accepts
 only content:// Uris but provides the result as a file:// Uri... so it
 can't edit it's own result again without us having to work this
 around...

 They could have added the result to the MediaStore and returned that
 uri... I'll have to do it myself or my edit button disappears after
 editing a picture...

 I think Adobe should fix this.

 Kevin

 On 11 mar, 16:43, webmonkey webmonke...@gmail.com wrote:

  The document provided by Adobe does not mention how you should read
  the returned Uri. For compatibility with future versions and other
  image editors, you should not assume that it is a 'file:' scheme 
  Uri,
  it could also be a 'content:' scheme Uri. The ContentResolver will
  handle it. here is the code:

  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent
  data)
  {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == LAUNCH_EDITOR)
      {
          if (resultCode == Activity.RESULT_OK)
          {
              Uri savedImage = data.getData();
              // savedImage is the Uri for the newly created
              // edited version of the original image.

              ContentResolver cr = getContentResolver();

              InputStream in = null;
              try {
                   in = cr.openInputStream(savedImage);
                   // you now have an InputStream to the saved image
                   // you can copy it by saving to an OutputStream
                   // or you can load it as a Bitmap
                   Bitmap bitmap = BitmapFactory.decodeStream(in);

              } catch (IOException e)
              {
              }
          }
          else
          {
              // Edit Operation canceled by user
          }
      }

  }

  On Mar 5, 9:10 pm, Adobe DI Mobile mobilead...@gmail.com wrote:

   ThePhotoshop.com Mobile editor is now available to the Android
   developer community as an activity that handles actions of type
   Intent.ACTION_EDIT, for image content that has data of mime-type
image/
   *.

   For more information on incorporating the editor into your Android
   application, please visit:
   http://mobile.photoshop.com/android/developers.html

--
You 

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-15 Thread Kevin Gaudin
Thanks for the tip, my storePicture() function was based on some code that I
had read in the android camera app... and I wasn't really happy with it so I
will sure modify this soon.

Thanks again !

On Mon, Mar 15, 2010 at 4:54 PM, webmonkey webmonke...@gmail.com wrote:

 For your storePicture function it is better to run the MediaScanner to
 add an image file to the MediaStore, see


 http://developer.android.com/reference/android/media/MediaScannerConnection.html

 Just create a MediaScannerConnection, provide a
 MediaScannerConnectionClient, and scan the file. The
 MediaScannerConnectionClient will give you the Uri in onScanCompleted.

 You can also use the MediaScanner in the getContentUriFromFile
 function. If should give you the Uri that already exists for the file,
 if not, it will add it automatically.

 It is much more future proof than adding an image manually using the
 MediaStore database.


 On Mar 15, 12:47 am, Nivek kevin.gau...@gmail.com wrote:
  You can use Astro File Manager or Estrongs File Explorer to backup the
  Photoshop app on your sdcard.
 
  Then, transfer the apk on your computer and install it on a running
  emulator using adb.
 
  adb install Photoshop.apk
 
  Now, I implemented a workaround for the problem I detected before:
  Photoshop can't edit its own results.
 
  Actually, I found out that Photoshop was storing its result in
  MediaStore, so it should have been able to send its result as a
 content://
  uri since MediaStore gives one !
 
  My workaround is to search in the MediaStore for the picture saved by
  Photoshop. I use the fact that MediaStore stores the path of images in
  their DATA column.
 
  Here is the code :
 http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
 
  Here is the call when receiving Photoshop's result:
 http://code.google.com/p/emailalbum/source/browse/EmailAlbumAndroid/t...
 
  Kevin
 
  On 13 mar, 15:59, nayana urs nayana...@gmail.com wrote:
 
 
 
   can we test this feature in emulator
   with regards
  Nayana
 
   On Fri, Mar 12, 2010 at 6:18 PM, Nivek kevin.gau...@gmail.com wrote:
 They could have added the result to the MediaStore and returned
 that
 uri... I'll have to do it myself or my edit button disappears after
 editing a picture...
 
Actually, this is what I will have to do as a workaround, but I can't
see any reason why they shouldn't accept a file:// uri as an input !
 
Kevin
 
On 13 mar, 03:10, Nivek kevin.gau...@gmail.com wrote:
 There is an inconsistency in their Uri handling... The app accepts
 only content:// Uris but provides the result as a file:// Uri... so
 it
 can't edit it's own result again without us having to work this
 around...
 
 They could have added the result to the MediaStore and returned
 that
 uri... I'll have to do it myself or my edit button disappears after
 editing a picture...
 
 I think Adobe should fix this.
 
 Kevin
 
 On 11 mar, 16:43, webmonkey webmonke...@gmail.com wrote:
 
  The document provided by Adobe does not mention how you should
 read
  the returned Uri. For compatibility with future versions and
 other
  image editors, you should not assume that it is a 'file:' scheme
 Uri,
  it could also be a 'content:' scheme Uri. The ContentResolver
 will
  handle it. here is the code:
 
  @Override
  public void onActivityResult(int requestCode, int resultCode,
 Intent
  data)
  {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == LAUNCH_EDITOR)
  {
  if (resultCode == Activity.RESULT_OK)
  {
  Uri savedImage = data.getData();
  // savedImage is the Uri for the newly created
  // edited version of the original image.
 
  ContentResolver cr = getContentResolver();
 
  InputStream in = null;
  try {
   in = cr.openInputStream(savedImage);
   // you now have an InputStream to the saved
 image
   // you can copy it by saving to an OutputStream
   // or you can load it as a Bitmap
   Bitmap bitmap = BitmapFactory.decodeStream(in);
 
  } catch (IOException e)
  {
  }
  }
  else
  {
  // Edit Operation canceled by user
  }
  }
 
  }
 
  On Mar 5, 9:10 pm, Adobe DI Mobile mobilead...@gmail.com
 wrote:
 
   ThePhotoshop.com Mobile editor is now available to the Android
   developer community as an activity that handles actions of type
   Intent.ACTION_EDIT, for image content that has data of
 mime-type
image/
   *.
 
   For more information on incorporating the editor into your
 Android
   application, please visit:
   

[android-developers] Re: NoClassDefFoundError for gdata CalendarService class

2010-03-15 Thread Tom
Thanks everyone for all of your suggestions. I haven't been able to
get the com.google.gdata classes to load properly in the emulator or
my N1 phone.

The stack trace indicates that the DVM cannot load classes in the
com.google.gdata.client packages, despite the jars being included in
the Eclipse project. My test app generates the following messages when
trying to instantiate a
com.google.gdata.client.calendar.CalendarService object:

W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
client/ca
lendar/CalendarService; (6)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
CalendarSe
rvice;' failed
E/dalvikvm(  220): Could not find class
'com.google.gdata.client.calendar.Cale
ndarService', referenced from method
com.tomoreilly.CalendarTest.onCreate
W/dalvikvm(  220): VFY: unable to resolve new-instance 15 (Lcom/google/
gdata/c
lient/calendar/CalendarService;) in Lcom/tomoreilly/CalendarTest;
D/dalvikvm(  220): VFY: replacing opcode 0x22 at 0x0012
D/dalvikvm(  220): Making a copy of Lcom/tomoreilly/
CalendarTest;.onCreate cod
e (608 bytes)
W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
client/ca
lendar/CalendarService; (6)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/client/calendar/
CalendarSe
rvice;' failed
I/dalvikvm(  220): Could not find method
com.google.gdata.client.calendar.Cale
ndarService.setUserCredentials, referenced from method
com.tomoreilly.Calendar
Test.onCreate
W/dalvikvm(  220): VFY: unable to resolve virtual method 46: Lcom/
google/gdata
/client/calendar/CalendarService;.setUserCredentials (Ljava/lang/
String;Ljava/
lang/String;)V
D/dalvikvm(  220): VFY: replacing opcode 0x6e at 0x0025
W/dalvikvm(  220): Unable to resolve superclass of Lcom/google/gdata/
data/cale
ndar/CalendarFeed; (20)
W/dalvikvm(  220): Link of class 'Lcom/google/gdata/data/calendar/
CalendarFeed
;' failed


I haven't been able to solve this specific problem, but instead have
decided to take the alternate approach suggested by Jim Blackler at
http://jimblackler.net/blog/?p=151 . His approach does not rely on
com.google.gdata classes, but instead uses an Intents mechanism that
is not documented by Google.

Regards,
Tom

On Mar 14, 12:37 am, Bob Kerns r...@acm.org wrote:
 Yes. The reason I do copy them (and recommend copying them) to a lib/
 directory is twofold:

 1) It makes them an explicit part of your project for versioning. If
 you use Subversion you can make these be a copy from a directory of
 third-party components. You could copy the third-party directory for
 tagging as well as your project, but this makes the dependency more
 apparent.

 2) It's compatible with how the ant build scripts are set up out-of-
 the-box, so it makes it easier to transition to an ant-based
 production build.

 But as you note, Eclipse doesn't really care.

 On Mar 13, 9:14 pm, Kumar Bibek coomar@gmail.com wrote:

  It doesn't really matter if you create a lib folder and put the jars
  and link them. It just works if you have added the jars the the build
  path. Though I am not able to figure out why you are getting this
  error.

-- 
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] Create Softkeyboard dynamically

2010-03-15 Thread Kritzli
Hi,

it's me again, with a new question.
Is it possible to write an Softkeyboard without XML or is this the
time i'll need it ?

The idea is:
I have an Arraylist with buttons which have a specific position in the
layout, height, width, text etc.
Those buttons should create my keyboard by converting them into keys.

If this won't work, my second idea is, to write a XML-File out of
Java.


I wonder if one of these ideas are possible.


Thanks in advance for any kind of 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: Device Seeding Program for Top Android Market Developers

2010-03-15 Thread f_heft
Thanks, finally I can test my own apps on a new device :)

But I can't tell if this is the Nexus I got because of my app in the
market (I got a confirmation mail on March 6th) or because I was an
ADC2 finalist (never got a confirmation mail but they already got my
adress from ADC2 so I guess there won't be another mail).
It was shipped by Brightpoint Netherlands I think (I don't have the
package here right now).



On 15 Mrz., 16:59, Thomas Riley tomrile...@googlemail.com wrote:
 Awesome! Enjoy! Time to go make some cool Android 2.x apps my
 friend! ;)

 Out of interest, did you receive a shipping email? Or just the
 confirmation email from google?

 Also, any idea who it was shipped from? ie, Brightstar?

 On Mar 15, 2:19 pm, f_heft delphik...@gmail.com wrote:



  I just received my Nexus One via FedEx - thank you, Google! :)

  Btw: No special branding or anything on the phone itself , it's
  exactly like the one you can buy :)
  And I got mine from the Netherlands (I'm living in Germany) and it was
  shipped on March 12th (for those of you who are still waiting).

  On 3 Mrz., 00:53, Larry lar...@gmail.com wrote:

   Dear all,

   I just received an email about Device Seeding Program for Top Android
   Market Developers:

   Subject: Device Seeding Program for Top Android Market Developers
   From: android-market-seed...@google.com

   Due to your contribution to the success of Android Market, we would
   like to present you with a brand new Android device as part of our
   developer device seeding program. You are receiving this message
   because you're one of the top developers in Android Market with one or
   more of your applications having a 3.5 star or higher rating and more
   than 5,000 unique downloads.

   In order to receive this device, you must click through to this site,
   read the terms and conditions of the offer and fill out the
   registration form to give us your current mailing address so that we
   can ship your device.

   You will receive either a Verizon Droid by Motorola or a Nexus One.
   Developers with mailing addresses in the US will receive either a
   Droid or Nexus one, based on random distribution. Developers from
   Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland,
   Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers
   with mailing addresses in countries not listed above will not receive
   a phone since these phones are not certified to be used in other
   countries.

   We hope that you will enjoy your new device and continue to build more
   insanely popular apps for Android!

   The email is from Google but I am still doubting somehow. Is this a
   spam? Any other developers receive this emails before?

   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


Re: [android-developers] Re: What is exactly an ANDROID_ID ?

2010-03-15 Thread Wayne Wenthin
If you use it while using items like android.os.Build.PRODUCT or something
similar you should be able to create a unique ID.  Of course with this is
the assumption that no manufacturer will duplicate.

On Mon, Mar 15, 2010 at 7:58 AM, Greg Donald gdon...@gmail.com wrote:

 On Mon, Mar 15, 2010 at 10:48 AM, Mark Murphy mmur...@commonsware.com
 wrote:
  ANDROID_ID is fine for casual use, but it's not exactly the Rock of
  Gibraltar, if you know what I mean.

 I can't think of a scenario where I would ever need it casually.
 Either I need it or I don't.


 --
 Greg Donald
 destiney.com | gregdonald.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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Writing code is one of few things
that teaches me I don't know everything.

Make Call Girl Manager great!
Join the forums.
http://www.fuligin.com/forums

-- 
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: Device Seeding Program for Top Android Market Developers

2010-03-15 Thread Thomas Riley
Awesome! I got my confirmation on 2nd March so with a bit of luck it
cant be too far behind :)

One quick question, what type of AC adapter was it provided with? US
spec?

On Mar 15, 4:14 pm, f_heft delphik...@gmail.com wrote:
 Thanks, finally I can test my own apps on a new device :)

 But I can't tell if this is the Nexus I got because of my app in the
 market (I got a confirmation mail on March 6th) or because I was an
 ADC2 finalist (never got a confirmation mail but they already got my
 adress from ADC2 so I guess there won't be another mail).
 It was shipped by Brightpoint Netherlands I think (I don't have the
 package here right now).

 On 15 Mrz., 16:59, Thomas Riley tomrile...@googlemail.com wrote:



  Awesome! Enjoy! Time to go make some cool Android 2.x apps my
  friend! ;)

  Out of interest, did you receive a shipping email? Or just the
  confirmation email from google?

  Also, any idea who it was shipped from? ie, Brightstar?

  On Mar 15, 2:19 pm, f_heft delphik...@gmail.com wrote:

   I just received my Nexus One via FedEx - thank you, Google! :)

   Btw: No special branding or anything on the phone itself , it's
   exactly like the one you can buy :)
   And I got mine from the Netherlands (I'm living in Germany) and it was
   shipped on March 12th (for those of you who are still waiting).

   On 3 Mrz., 00:53, Larry lar...@gmail.com wrote:

Dear all,

I just received an email about Device Seeding Program for Top Android
Market Developers:

Subject: Device Seeding Program for Top Android Market Developers
From: android-market-seed...@google.com

Due to your contribution to the success of Android Market, we would
like to present you with a brand new Android device as part of our
developer device seeding program. You are receiving this message
because you're one of the top developers in Android Market with one or
more of your applications having a 3.5 star or higher rating and more
than 5,000 unique downloads.

In order to receive this device, you must click through to this site,
read the terms and conditions of the offer and fill out the
registration form to give us your current mailing address so that we
can ship your device.

You will receive either a Verizon Droid by Motorola or a Nexus One.
Developers with mailing addresses in the US will receive either a
Droid or Nexus one, based on random distribution. Developers from
Canada, EU, and the EEA states (Norway, Lichtenstein), Switzerland,
Hong Kong, Taiwan, and Singapore will receive a Nexus One. Developers
with mailing addresses in countries not listed above will not receive
a phone since these phones are not certified to be used in other
countries.

We hope that you will enjoy your new device and continue to build more
insanely popular apps for Android!

The email is from Google but I am still doubting somehow. Is this a
spam? Any other developers receive this emails before?

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: Failed to create a UDP Server on Android phone

2010-03-15 Thread Gozde
Well, I am also interested in any comments..

Thanks!

On Mar 13, 12:37 pm, Larry lar...@gmail.com wrote:
 I have tried many tests on how to create a UDP server on android
 phone.

 - Devices I was testing:

 PC (has static public IP over Internet. has a UDP server running)
 GPhone (it is real phone, not emulator. runs in Tmobile 3G network)

 - Send a UDP packet from GPhone to PC:

 [On GPhone:]
 // create a sender socket
 DatagramSocket udpClientSocket= new DatagramSocket();
 // send data
 udpClientSocket.send(packet);

 [On PC:]
 // create a listener socket
 DatagramSocket udpServerSocket = new DatagramSocket(SERVER_PORT);
 // receive data
 udpServerSocket.receive(packet);

 - Send a UDP packet from PC to GPhone

 After a whole day testing on this problem, I can only find this
 solution:

 [On PC:]
 // get the client's address and port
 address = packet.getAddress();
 port = packet.getPort();
 // create packet to send to client
 packet = new DatagramPacket(address, port);
 // use the server socket to send a packet
 udpServerSocket.send(packet);

 [On GPhone:]
 // use the sender socket to receive data
 udpClientSocket.receive(packet);

 With these codes, the client can actually receive packet from server.
 However, there are 2 problems:

 1. YOU HAVE TO USE THE SERVER SOCKET TO SEND

 If we change the PC code to:
 .(same stuff)
 // create a new socket to send data
 DatagramSocket anotherSocket = new DatagramSocket();
 anotherSocket.send(packet);

 The phone will never receive the packet.

 2. YOU CANNOT ESTABLISH A UDP SERVER ON GPHONE

 If we want to have a UDP server on GPhone just like we have a server
 on PC. So that GPhone can talk to a server on PC and PC can talk to
 another server on GPhone, using DatagramSocket udpGPhoneServerSocket =
 new DatagramSocket(GPHONE_SERVER_PORT) DOES NOT WORK.

 I have tried to send a UDP packet from PC to the phone. I tried all
 kinds of ports, addresses, etc. No, it doesn't work.

 * * * * * * * * * * * * * * * * * * * * * * * *

 OK. Now in my android app, I have over 100 clients (GPhone)
 communicating to the server (PC) at same time. For performance
 concern, I want to create one UDP server socket on PC *ONLY* for
 receiving. Then I create one UDP sending socket per connection on the
 server to send packets back to the phone. Based on my test, since
 establishing a UDP server socket on GPhone is not working. The only
 option left for me is to use the only UDP server socket for both
 receiving and sending.

 My questions are:

 1. Am I wrong? (Does any1 have a successful design so that you can
 send a packet from PC to GPhone without reusing the server socket?)
 2. If I am correct, is it T-mobile blocking all UDPs?
 3. If I use the *ONLY* server socket for both sending and receiving to
 handle 100+ connections with real-time data exchanging at same time,
 does it have a poor performance? Any better solutions?

 Any comments are appreciated!

-- 
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] Failed to create a UDP Server on Android phone

2010-03-15 Thread pankaj anand
You might need to allow permission in manifest file to enable ur code to
create server socket.

uses-permission
android:name=android.permission.INTERNET/uses-permission

I am not very sure but this thing worked in my case when i was trying to
create a  UDP socket.

enjoy
Pankaj anad

On Sat, Mar 13, 2010 at 7:07 AM, Larry lar...@gmail.com wrote:

 I have tried many tests on how to create a UDP server on android
 phone.

 - Devices I was testing:

 PC (has static public IP over Internet. has a UDP server running)
 GPhone (it is real phone, not emulator. runs in Tmobile 3G network)

 - Send a UDP packet from GPhone to PC:

 [On GPhone:]
 // create a sender socket
 DatagramSocket udpClientSocket= new DatagramSocket();
 // send data
 udpClientSocket.send(packet);

 [On PC:]
 // create a listener socket
 DatagramSocket udpServerSocket = new DatagramSocket(SERVER_PORT);
 // receive data
 udpServerSocket.receive(packet);

 - Send a UDP packet from PC to GPhone

 After a whole day testing on this problem, I can only find this
 solution:

 [On PC:]
 // get the client's address and port
 address = packet.getAddress();
 port = packet.getPort();
 // create packet to send to client
 packet = new DatagramPacket(address, port);
 // use the server socket to send a packet
 udpServerSocket.send(packet);

 [On GPhone:]
 // use the sender socket to receive data
 udpClientSocket.receive(packet);

 With these codes, the client can actually receive packet from server.
 However, there are 2 problems:

 1. YOU HAVE TO USE THE SERVER SOCKET TO SEND

 If we change the PC code to:
 .(same stuff)
 // create a new socket to send data
 DatagramSocket anotherSocket = new DatagramSocket();
 anotherSocket.send(packet);

 The phone will never receive the packet.

 2. YOU CANNOT ESTABLISH A UDP SERVER ON GPHONE

 If we want to have a UDP server on GPhone just like we have a server
 on PC. So that GPhone can talk to a server on PC and PC can talk to
 another server on GPhone, using DatagramSocket udpGPhoneServerSocket =
 new DatagramSocket(GPHONE_SERVER_PORT) DOES NOT WORK.

 I have tried to send a UDP packet from PC to the phone. I tried all
 kinds of ports, addresses, etc. No, it doesn't work.

 * * * * * * * * * * * * * * * * * * * * * * * *

 OK. Now in my android app, I have over 100 clients (GPhone)
 communicating to the server (PC) at same time. For performance
 concern, I want to create one UDP server socket on PC *ONLY* for
 receiving. Then I create one UDP sending socket per connection on the
 server to send packets back to the phone. Based on my test, since
 establishing a UDP server socket on GPhone is not working. The only
 option left for me is to use the only UDP server socket for both
 receiving and sending.

 My questions are:

 1. Am I wrong? (Does any1 have a successful design so that you can
 send a packet from PC to GPhone without reusing the server socket?)
 2. If I am correct, is it T-mobile blocking all UDPs?
 3. If I use the *ONLY* server socket for both sending and receiving to
 handle 100+ connections with real-time data exchanging at same time,
 does it have a poor performance? Any better solutions?

 Any comments are appreciated!

 --
 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.comandroid-developers%2bunsubscr...@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: Sending huge files with HttpsUrlConnection???

2010-03-15 Thread Kevin Huber

On Mar 12, 6:17 pm, AuxOne tyler.thack...@gmail.com wrote:
 I have some Android code that can send files to my webserver using an
 HttpsUrlConnection, but when it tries to send larger files I get an
 OutOfMemory exception when opening the OutputStream. Can anyone offer
 some assistance?

I sent this to the group, but it may take a while for my post to get
approved.

I would try using the Apache HttpClient instead of HttpsURLConnection.


package khuber.sendlargefile;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.widget.TextView;

public class SendLargeFile extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Sender s = new Sender();
s.start();
}

final Handler handler = new Handler();

final Runnable showMessage = new Runnable() {
public void run() {
message();
}
};

String message;

public void message() {
TextView tv = new TextView(this);
tv.setText(response= + message);
setContentView(tv);
}

class Sender extends Thread {
public void run() {
String msg = ;

String url = http://192.168.0.128:8080/PostDemo/
PostServlet;
File file = new
File(Environment.getExternalStorageDirectory(),
test2.dat);
try {
HttpClient httpclient = new DefaultHttpClient();

HttpPost httppost = new HttpPost(url);

Log.i(SendLargeFile, before send);
Log.i(SendLargeFile, file length =  +
file.length());

InputStreamEntity reqEntity = new InputStreamEntity(
new FileInputStream(file), -1);
reqEntity.setContentType(binary/octet-stream);
reqEntity.setChunked(true);
httppost.setEntity(reqEntity);
Log.i(SendLargeFile, before execute);
HttpResponse response = httpclient.execute(httppost);
Log.i(SendLargeFile, response =  +
response.getStatusLine());

HttpEntity resEntity =
response.getEntity();
StringBuilder sb = new StringBuilder();
if (resEntity != null) {
byte[] buf = new byte[512];
InputStream is = resEntity.getContent();
int n = 0;
while ((n = is.read(buf))  0) {
sb.append(new String(buf, 0, n));
}
is.close();
resEntity.consumeContent();
}
msg = sb.toString();

} catch (Exception e) {
msg = e.toString();
}

message = msg;
handler.post(showMessage);
}
}
}

-- 
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] GL11Ext.glCurrentPaletteMatrixOES problem

2010-03-15 Thread JimVonMoon
Hello! :-)

I'll try to make this brief:

public void draw(GL10 gl)
{
  gl.glMatrixMode(GL11Ext.GL_MATRIX_PALETTE_OES);
  ((GL11Ext)gl).glCurrentPaletteMatrixOES(0); //  I get
java.lang.UnsupportedOperationException here.
}

I am using Android emulator under Windows XP and Eclipse. So my
question is:
Is that just an emulator issue or is it really unsupported?

I wanted to check if Android SDK is any good before I buy a real
device so I can't verify that issue by myself. As for now I can't say
that I like this SDK - necessity to cast GL10 objects to GL11, GL11Ext
etc. is ummm... barbaric? I also had problems with directional
lighting and now this - go figure...

Anyway, thanks for help. :-)

--
Cheers, :-)
JimVonMoon

-- 
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] Transparent option menu buttons

2010-03-15 Thread Samuel Allaby
Hi, is there a way to make the buttons within the option menu
transparent? I'm using icons and no text for my buttons but I really
don't want the nasty grey backgrounds as well, and the techniques
often mentioned for making normal buttons transparent don't seem to be
working...

Any thoughts?

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: Sending huge files with HttpsUrlConnection???

2010-03-15 Thread Kevin Huber
On Mar 12, 6:17 pm, AuxOne tyler.thack...@gmail.com wrote:
 I have some Android code that can send files to my webserver using an
 HttpsUrlConnection, but when it tries to send larger files I get an
 OutOfMemory exception when opening the OutputStream. Can anyone offer
 some assistance?

I would try using the Apache HttpClient instead of HttpsURLConnection.
I'm not using https in this example, but it is supported.

My test servlet reports size and elapsed time back to the caller. It
took about two minutes to send 180M with the emulator.


package khuber.sendlargefile;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.widget.TextView;

public class SendLargeFile extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Sender s = new Sender();
s.start();
}

final Handler handler = new Handler();

final Runnable showMessage = new Runnable() {
public void run() {
message();
}
};

String message;

public void message() {
TextView tv = new TextView(this);
tv.setText(response= + message);
setContentView(tv);
}

class Sender extends Thread {
public void run() {
String msg = ;

String url = http://192.168.0.128:8080/PostDemo/
PostServlet;
File file = new
File(Environment.getExternalStorageDirectory(),
test2.dat);
try {
HttpClient httpclient = new DefaultHttpClient();

HttpPost httppost = new HttpPost(url);

Log.i(SendLargeFile, before send);
Log.i(SendLargeFile, file length =  +
file.length());

InputStreamEntity reqEntity = new InputStreamEntity(
new FileInputStream(file), -1);
reqEntity.setContentType(binary/octet-stream);
reqEntity.setChunked(true);
httppost.setEntity(reqEntity);
Log.i(SendLargeFile, before execute);
HttpResponse response = httpclient.execute(httppost);
Log.i(SendLargeFile, response =  +
response.getStatusLine());

HttpEntity resEntity =
response.getEntity();
StringBuilder sb = new StringBuilder();
if (resEntity != null) {
byte[] buf = new byte[512];
InputStream is = resEntity.getContent();
int n = 0;
while ((n = is.read(buf))  0) {
sb.append(new String(buf, 0, n));
}
is.close();
resEntity.consumeContent();
}
msg = sb.toString();

} catch (Exception e) {
msg = e.toString();
}

message = msg;
handler.post(showMessage);
}
}
}

-- 
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] Streaming video from Android handset - code examples anywhere?

2010-03-15 Thread pankaj anand
you should look at the sip phone sipdroid which is SIP phone for android. If
you understand it well then you should be able to do it the same way with
the video as well.



On Tue, Feb 16, 2010 at 11:01 PM, jussi69 jussiniemin...@gmail.com wrote:

 Hi,

 I'm in the process of writing an application that would be streaming
 live video from Android handset into a server that resides in the
 internet. Are there any code examples that can handle this? I've been
 trying to search code examples, but could not find any. I have also
 bought a couple of Android development books, but none of those
 covered this kind of functionality.

 Any help would be greatly appreciated. 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.comandroid-developers%2bunsubscr...@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] More Map Troubles

2010-03-15 Thread David Williams
Follow this procedure and do what it say's about the KEY and what to add to
the XML
In fact, if you follow this exact it will work.. The problem is you have not
done the key part

http://mobiforge.com/developing/story/using-google-maps-android




On Thu, Mar 11, 2010 at 1:39 PM, Jason Kahler jason.kah...@gmail.comwrote:

 I have been trying to get a MapActivty to run properly in me app for a few
 days now. I have a class that extends MapActivity. I have my map api key
 properly defined in the layout xml file.
 I have built against the Google APi version 4? (whatever maps to android
 1.6) I can compile fine but My app throws a ClassDefNotFound error for my
 MyActivity class(the one that extends MapActivity
 ) I also added the uses-lib tag in the manifest. I have no idea what I'm
 missing 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.comandroid-developers%2bunsubscr...@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] More Map Troubles

2010-03-15 Thread David Williams
You have to do the procedure for the API key.

You also have to have the permission in the XML




On Thu, Mar 11, 2010 at 1:39 PM, Jason Kahler jason.kah...@gmail.comwrote:

 I have been trying to get a MapActivty to run properly in me app for a few
 days now. I have a class that extends MapActivity. I have my map api key
 properly defined in the layout xml file.
 I have built against the Google APi version 4? (whatever maps to android
 1.6) I can compile fine but My app throws a ClassDefNotFound error for my
 MyActivity class(the one that extends MapActivity
 ) I also added the uses-lib tag in the manifest. I have no idea what I'm
 missing 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.comandroid-developers%2bunsubscr...@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] Failed to create a UDP Server on Android phone

2010-03-15 Thread pankaj anand
You might need to allow permission in manifest file to enable ur code to
create server socket.

uses-permission
android:name=android.permission.INTERNET/uses-permission

I am not very sure but this thing worked in my case when i was trying to
create a  UDP socket.

enjoy
Pankaj anand

On Sat, Mar 13, 2010 at 7:07 AM, Larry lar...@gmail.com wrote:

 I have tried many tests on how to create a UDP server on android
 phone.

 - Devices I was testing:

 PC (has static public IP over Internet. has a UDP server running)
 GPhone (it is real phone, not emulator. runs in Tmobile 3G network)

 - Send a UDP packet from GPhone to PC:

 [On GPhone:]
 // create a sender socket
 DatagramSocket udpClientSocket= new DatagramSocket();
 // send data
 udpClientSocket.send(packet);

 [On PC:]
 // create a listener socket
 DatagramSocket udpServerSocket = new DatagramSocket(SERVER_PORT);
 // receive data
 udpServerSocket.receive(packet);

 - Send a UDP packet from PC to GPhone

 After a whole day testing on this problem, I can only find this
 solution:

 [On PC:]
 // get the client's address and port
 address = packet.getAddress();
 port = packet.getPort();
 // create packet to send to client
 packet = new DatagramPacket(address, port);
 // use the server socket to send a packet
 udpServerSocket.send(packet);

 [On GPhone:]
 // use the sender socket to receive data
 udpClientSocket.receive(packet);

 With these codes, the client can actually receive packet from server.
 However, there are 2 problems:

 1. YOU HAVE TO USE THE SERVER SOCKET TO SEND

 If we change the PC code to:
 .(same stuff)
 // create a new socket to send data
 DatagramSocket anotherSocket = new DatagramSocket();
 anotherSocket.send(packet);

 The phone will never receive the packet.

 2. YOU CANNOT ESTABLISH A UDP SERVER ON GPHONE

 If we want to have a UDP server on GPhone just like we have a server
 on PC. So that GPhone can talk to a server on PC and PC can talk to
 another server on GPhone, using DatagramSocket udpGPhoneServerSocket =
 new DatagramSocket(GPHONE_SERVER_PORT) DOES NOT WORK.

 I have tried to send a UDP packet from PC to the phone. I tried all
 kinds of ports, addresses, etc. No, it doesn't work.

 * * * * * * * * * * * * * * * * * * * * * * * *

 OK. Now in my android app, I have over 100 clients (GPhone)
 communicating to the server (PC) at same time. For performance
 concern, I want to create one UDP server socket on PC *ONLY* for
 receiving. Then I create one UDP sending socket per connection on the
 server to send packets back to the phone. Based on my test, since
 establishing a UDP server socket on GPhone is not working. The only
 option left for me is to use the only UDP server socket for both
 receiving and sending.

 My questions are:

 1. Am I wrong? (Does any1 have a successful design so that you can
 send a packet from PC to GPhone without reusing the server socket?)
 2. If I am correct, is it T-mobile blocking all UDPs?
 3. If I use the *ONLY* server socket for both sending and receiving to
 handle 100+ connections with real-time data exchanging at same time,
 does it have a poor performance? Any better solutions?

 Any comments are appreciated!

 --
 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.comandroid-developers%2bunsubscr...@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] Re: General lag issues with real-time games

2010-03-15 Thread mc06050145 Iram Khan
On Sun, Mar 14, 2010 at 5:28 PM, Lance Nanek lna...@gmail.com wrote:

 One thing to watch out for with MediaPlayer is that the format matters
 a lot. I've seen the G1 go from 60 FPS to 50 FPS just because I added
 MP4 music, then act fine once I converted it to highly compressed,
 mono OGG or substituted it with MIDI. I suppose other apps playing
 music in the background could similarly really hurt frame rate.

 There are a lot of other threads re leaving a finger down. Lots of
 things have been discussed for that like blocking the UI thread until
 the input is handled by the game thread or adding a short sleep on the
 UI thread, upping the priorities on your game/render threads, and
 catching the event early on dispatch instead of on touch.

 On Mar 14, 6:26 am, Yahel kaye...@gmail.com wrote:
  My two cents,
 
  In my game I noticed two things :
 
  1) Media player is killing my frame rate in two player mode : from 50
  to 20. So I had to remove music for that part of the game. Sounds
  triggered by the soundpool works fine.
 
  2) Touching the screen kills my frame rate as well, short press are
  ok, but if one of the player leaves is finger down, then I drop to
  10-15 frame/secondes.
 
  Is it not possible as Lance stated, that user are not using touch
  screen control the way you expect, long touching the screen or
  something similar therefore giving the feeling of a lag ?
 
  I've been thinking for a while about doing something that feels nasty
  but could be an answer :
  Allocate as much memory(12M ? 24M ?) as you can during the loading of
  the game. This would force Android to look for memory somewhere else
  and therefore kill as many non useful process as possible.
  That sounds evil doesn't it ? But I'm not sure if it would work
  anyway, I didn't try yet :)
 
  Yahel

 --
 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.comandroid-developers%2bunsubscr...@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] Getting the battery current and voltage values for the Android Phone

2010-03-15 Thread Chintan
I am trying to collect power usage statistics for the Android G1
Phone. I am interested in knowing the values of Voltage and Current,
and then able to collect statistics as reported here
http://dl.google.com/io/2009/pres/W_0300_CodingforLife-BatteryLifeThatIs.pdf

I am able to get the value of Battery voltage through registering for
an intent receiver to receive the Broadcast for
ACTION_BATTERY_CHANGED. But the problem is that Android does not
expose the value of current through this SDK interface.

One way I tried is via sysfs interface, where I can view the battery
current value from adb shell, using the following command

$cat /sys/class/power_supply/battery/batt_current
449

But that too works only if the phone is connected via USB interface.
If I disconnect the phone, I see the value of batt_current as '0'. I
am not sure why the value of current reported is zero. It should be
more than zero, right?

Any suggestion / pointers for getting battery current value? Also
please correct me if I am wrong.

-- 
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 2.1 Gallery - menu controls

2010-03-15 Thread Chefgon
I recently got a Nexus One, and it includes a very impressive photo
gallery application.  Of particular interest is its menu, which is
quite a bit different and more intuitive than the one found elsewhere
in the system.  Clicking on More or Share will load lists in
Windows-style pop-up menus instead of the full-screen lists that are
commonly seen elsewhere.

Is this new menu control available in the Android 2.1 SDK for use in
my own applications?  Or is it a totally custom implementation
internal to the Gallery app?  I'd really like to use it but it seems
like it would be pretty complicated to build from scratch.

-- 
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] Take pictures without freezing the preview?

2010-03-15 Thread Gasal
Hi there

Does anyone know whether it's possible to take high-resolution
pictures without interrupting the camera preview?

camera.takePicture(...) causes the preview to freeze briefly even if
I immediately restart it in onPictureTaken(...)...

Anyone any suggestions?

Cheers
Alexander

-- 
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] Simple Multiplayer Example please

2010-03-15 Thread Tom
So I am new to developing with Android and would like some help/
examples/tutorials please Basically I have the exact same game on
two android phones. I would like for phone 1 to pick a number and then
send it to phone 2. Then the application on phone 2 would get that
number, compare it to what it has, and send a message back to phone 1
saying who the winner is. That's it, so any ideas, help, examples,
etc, anything please. I am new at Java and Android but well versed in
C#. 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] onContextItemSelected does not respond

2010-03-15 Thread ccal
Hello,

I am creating a context menu in separate class from the listview,
because the contextmenu will be access by several listviews in
different classes.
Whenever I long-click the listview, contextmenu pops up, but nothing
happens when the options were chosen.
Tried to look at logcat message and it said something like this:

Window already focused, ignoring focus gain of:
com.android.internal.view.iinputmethodclient$stub$pr...@43c488f8

Any idea what really causing this problem?
cause it works perfectly fine if i put the contextmenu on the same
class as listview.


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


Re: [android-developers] Re: is there a way to get a view to the front?

2010-03-15 Thread mc06050145 Iram Khan
On Sun, Mar 14, 2010 at 5:38 PM, mot12 martin.hu...@gmail.com wrote:

 That's what I did. No luck.

 Anyhow, the xml layout way gives me more freedom. I now have to
 filters, one put on top of the background and one on top of the
 foreground. This way, when dimming the display, I can let the
 background fade quicker than the foreground which increases
 readability. I am very happy with how it turns out :).

 --
 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.comandroid-developers%2bunsubscr...@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] Getting quick location fix in alarm service

2010-03-15 Thread Franklin
I was wondering about the following scenario: I have an application
that periodically needs to do some stuff, and at first I found that
starting it as an alarm service was a neat way conserving resources
AND being sure that the service would execute. However, my service
also needs to know the location of the device, and I found that using
getLastKnownLocation does not suffice as the location tends to be
drastically outdated. I then tried adding a location listener, and
requested location updates as frequently as possible, but then it
could still take minutes before any location event was fired. So, now
I have it running as a standard background service but I really don't
like that approach.

Is it possible to force a location fix within limited given that the
circumstances enable acquiring a fix at all? Again,
getLastKnownLocation does not suffice.

-- 
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] Unresolvable references

2010-03-15 Thread mob1lejunkie
I need to create paused analog clock. Since I have never done any
graphics/drawing before I am customizing Analogue widget defined in
the core/java/android/widget.

The problem is when I create the class in my project following are the
unresolved references:
mContext
com.android.internal.R
mRight
mLeft
mTop
mBottom

I know the most likely cause is com.android.internal is private and I
need to use public but the problem I do not know what the public
equivalent is. I have tried substituing it with android.R but that
doesn't seem work either.

What should I do?

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] MediaPlayer playback is slow

2010-03-15 Thread Chris_V
Hi.

I am writing a media record/player on my Android 2.1 Emulator.  I have
successfuly recorded an audio in the AMR format and can play it back
too.  However, the playback is slow.  About 50% speed.  I am wondering
if this is an issue with the Emulator.  I do not have a real device to
test on.  I was wondering if anyone had experienced this.

Below is some setup code.  Hope it helps.

Thanks!
Chris

// Recorder
MR=new MediaRecorder();
MR.setAudioSource(MediaRecorder.AudioSource.MIC);

MR.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
MR.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

// Player
MP = new MediaPlayer();

-- 
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] VLC on Android

2010-03-15 Thread Enéas Gesing
Hi,

I'm newbie on Android development, but I have a complex task: support media
in Windows Media formats and stream (WMV, WMA, MMS protocol, ASX ...).

I think that port libVLC http://wiki.videolan.org/Libvlc (C++) to Android
is the short way. Anybody already have tried to do this? Is it possible?

I'm reading about binding it to Java using
VLCJhttp://code.google.com/p/vlcj/,
but no success on apply it to Android yet.

Regards,

Enéas Gesing

-- 
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: NoClassDefFoundError for gdata CalendarService class

2010-03-15 Thread David Williams
They go under resource



On Sat, Mar 13, 2010 at 6:21 PM, Tom orei...@mbari.org wrote:



 On Mar 13, 3:15 pm, Mark Murphy mmur...@commonsware.com wrote:
  Tom wrote:
   I'm writing an android 2.1 application that writes an entry to my
   Google calendar. The relevant part of my application code looks like
   this:
 
  void addCalendarEntry(String googleUser, String password)
  throws Exception {
 
  URL postURL =
   new URL(http://www.google.com/calendar/feeds/; +
   googleUser +
/private/full);
 
  CalendarService myService =
   new CalendarService(myCompany-exampleApp-1.0);
 
   This code compiles with no errors, using Eclipse on MacOS, using
   external jar files from the Google gdata project:
   gdata/java/lib/gdata-calendar-2.0.jar
   gdata/java/lib/gdata-calendar-meta-2.0.jar
 
  Did you copy these into your project's libs/ directory?
 

 No, I merely specified the path to the external jar in the Eclipse
 Java build path libraries dialog. This seemed to work for other
 projects I've developed. I look in my Eclipse project workspace and
 see assets, bin, gen, res, and src directories but no libs. Where
 should that directory appear?

 Thanks very much,
 Tom

  --
   Mark Murphy (a Commons Guy)http://commonsware.com|
 http://twitter.com/commonsguy
 
  Android Training in US: 14-18 June 2010:http://bignerdranch.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.comandroid-developers%2bunsubscr...@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

  1   2   3   >