[android-developers] Re: Problem with setExtra

2009-06-23 Thread Will

Thank you, fine people. I'm just going to hack my way around 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
-~--~~~~--~~--~--~---



[android-developers] Re: DEVELOPER CHALLENGE 2 - Can update of existing published app can participate?

2009-06-23 Thread havexz

Can any one from Google reply to this ...as time is passing
everyday?

On Jun 18, 11:05 pm, havexz bali.param...@gmail.com wrote:
 I M NOT A GOOGLE REPRESENTATIVE.THESE ARE MY PERSONAL VIEWS

 What I think that Google is not allowing published apps:
 - Published apps are more mature as they are live apps.
 - Published apps are coded way before so they have more set of
 features.
 - They want the apps for DC2 be built with in a month or two time
 frame.

 If they put restriction on these basis then a developer who is working
 for a long time on android platform should be competing with a
 developer who just started to develop for the DC2.

 * One more suggestion is that they can put a limit on time for
 which the application is published. Say application should be
 published before six months or something

 * Another suggestion is they create a new category for published
 apps and all published apps compete that category.

 * The last suggestion which i mentioned earlier also, that there
 has to be substantial difference between the feature set to be
 eligible for DC2

 What I feel that published apps be treated the same way as un
 published ones.

 On Jun 18, 6:44 pm, Eric Wong (hdmp4.com) ericwon...@gmail.com
 wrote:

  This was debated a few days after ADC2 was announced and no consensus
  was found among developers.

  Check the older posts.

  Btw, everyone are waiting clarification on this for weeks.

  Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Mimetype from extentions? (.txt/.vcf)

2009-06-23 Thread ylx_presid...@hotmail.com

Hi,

I am trying to get Mimetype from extention for .txt file, using below
method:
MimeTypeMap map = MimeTypeMap.getSingleton();
type = map.getMimeTypeFromExtension(extension);

But the returned type is always null.

Looking into MimeTypeMap.java code,  in function loadEntry(), I found
below codemsg.
private void loadEntry(String mimeType, String extension,
boolean textType) {
..
// here, we don't want to map extensions to text MIME types;
// otherwise, we will start replacing generic text/plain and
// text/html with text MIME types that our platform does not
// understand.
//
if (!textType) {
mExtensionToMimeTypeMap.put(extension, mimeType);
}
}

Per above codes, all text series extentions (like txt, rtf, text,
vcf...)  can not get Mimetype using the getMimeTypeFromExtension()
function.

Is there any other way to get Mimetype for *.txt or *.vcf file?

Thanks,
ylx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: READ_CALENDAR and WRITE_CALENDAR

2009-06-23 Thread Kaj Bjurman

Is there somewhere where we can see when it's scheduled for release?

Several people have told me that they don't like the Calendar widget
since it only displays the next upcoming event. It would be far better
if it could be configured to display the X next upcoming events within
a given horizon. E.g display maximum 5 events, but only if they are
within the next 2 weeks.

I thought it sounded pretty easy to create a widget that did that, but
it's kind of disappointing that it isn't possible right now :(



On 18 Juni, 21:14, Dianne Hackborn hack...@android.com wrote:
 No.  Like I said, this API is not yet public.





 On Thu, Jun 18, 2009 at 2:04 AM, Kaj Bjurman kaj.bjur...@gmail.com wrote:

  Is there a public api for reading the Calendar?

  On 18 Juni, 10:30, Dianne Hackborn hack...@android.com wrote:
   This is not a public API, please don't use it.

   On Thu, Jun 18, 2009 at 1:24 AM, Karima karima.ra...@gmail.com wrote:

Found :http://caustiq.esoteriq.org/nb/

Uri uri = Uri.parse(content://calendar/events);
ContentResolver cr = context.getContentResolver();

ContentValues values = new ContentValues();
values.put(eventTimezone, EST);
values.put(calendar_id, 1); // query content://calendar/calendars
for more
values.put(title, Party over thurr);
values.put(allDay, 0);
values.put(dtstart, dtstart); // long (start date in ms)
values.put(dtend, dtend);     // long (end date in ms)
values.put(description, Bring computers and alcohol);
values.put(eventLocation, ZA WARULDO);
values.put(transparency, 0);
values.put(visibility, 0);
values.put(hasAlarm, 0);

cr.insert(uri, values);

With :

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

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

/manifest

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

 --
 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: Reading a large url

2009-06-23 Thread bsbi...@googlemail.com

Hi,

The example I posted is a cut down version.

In the real example the inputstream is passed as a argument to the sax
parser.

I just wanted to show that the

 String line = buff.readLine();
System.out.println(line);
while (line != null) {
line = buff.readLine();
System.out.println(line);
}

Does not read the whole rss.xml on the HTC android phone



On Jun 22, 5:05 pm, Marco Nelissen marc...@android.com wrote:
 On Mon, Jun 22, 2009 at 5:09 AM, bsbi...@googlemail.com 

 bsbi...@googlemail.com wrote:

  Hello,

  I am reading the following URL to test a RSS parser.

 http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xm

  When using the same code on a Android HTC phone the whole resource
  cannot be read. There are no exceptions being thrown. I am guessing
  the rss.xml is too large to be read in?

  I use a sax parser after the block of code which complains.

 Complains about what? The code you posted tries to read the entire file and
 dumps it to stdout, which means that even you passed the input stream to the
 parser (which the code you posted doesn't do, since the input stream object
 has limited scope), there would not be anything left for it to read.





                 try {
                         InputStream urlInputStream = null;

                         URL url = new URL(http://newsrss.bbc.co.uk/rss/
  newsonline_uk_edition/uk/rss.xmlhttp://newsrss.bbc.co.uk/rss/%0Anewsonline_uk_edition/uk/rss.xml
  );

                         BufferedReader buff = new BufferedReader(new
  InputStreamReader
  (url.openStream()));

                         String line = buff.readLine();
                         System.out.println(line);

                         while (line != null) {
                                 line = buff.readLine();
                                 System.out.println(line);
                         }

                         if (urlInputStream != null) {
                                 urlInputStream.close();
                         }
                 } catch (MalformedURLException e) {
                         e.printStackTrace();
                 } catch (IOException e) {
                         e.printStackTrace();
                 }
         }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Invoking Activity from PendingIntent in NotificationManager

2009-06-23 Thread jens hohl

Thanks,

finally i got it working. The Log was empty but i forget to declare it
in the Manifest.xml

On 22 Jun., 19:42, Josh Guilfoyle jast...@gmail.com wrote:
 Check with adb logcat to see if there was a problem launching your
 activity.  My initial guess is that you forgot to declare this
 activity in the AndroidManifest.xml file.  You also should not need to
 use FLAG_CANCEL_CURRENT, nor should you need to use
 Main.this.getBaseContext, as any Context would suffice, including
 Main.this.

 On Jun 22, 1:05 am, mac-systems jens.h...@gmx.de wrote:

  Hello,

  i want to Inform the User about an Event from my Application using the
  NotificationManager and then invoking a Activity with details about
  the Event.

  As far as i know it should work like this:

                                  final NotificationManager mManager = 
  (NotificationManager)
  getSystemService(Context.NOTIFICATION_SERVICE);

                                  Intent intent = new Intent(Main.this,
  AlarmNotificationDetail.class);

                                  Notification notification = new 
  Notification(R.drawable.icon,
  Notify, System.currentTimeMillis());
                                  notification.setLatestEventInfo(Main.this, 
  App Name,
  Description of the notification,PendingIntent
                                                  
  .getActivity(Main.this.getBaseContext(), 0, intent,
 PendingIntent.FLAG_CANCEL_CURRENT));
                                  mManager.notify(815, notification);

  This put an Event in my Statusbar, but it do not forward to the
  AlarmNotificationDetail.class Activity. Main.this is the Context from
  which this Event is triggered.

  The Activity to Invoke looks live this and should  bring up a Toast
  when created:

  public class AlarmNotificationDetail extends Activity
  {

          /*
           * (non-Javadoc)
           *
           * @see android.app.Activity#onCreate(android.os.Bundle)
           */
          @Override
          protected void onCreate(Bundle savedInstanceState)
          {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.alarmnotificationdetail);

                  Toast.makeText(this, this is a toast, Toast.LENGTH_LONG);
          }

  }

  Anyone can help me out ?

  regards,
  Mac
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ExifInterface and libexif

2009-06-23 Thread Augustin.CL

I found that we should use 200/1 as the value due to the Exif2.2
But I feel confused of that the values of the attributes will be
wrong.

The front part of the values of the longitude will be the values of
the GPSImgDirection.
I think that there is a bug about saving the gps attributes.

BTW, Does anyone has any idea about this topic?
There are few article around this topic on the internet...


On Jun 20, 12:51 am, Augustin.CL iamaugus...@gmail.com wrote:
 Could I use ExifInterface.java to getAttributes ,put some Exif Tag
 into that HashMap, saveAttributes and commitChanges?
 For Example:
     ExifInterface exif = new ExifInterface(filePath);
     HashMapString,String exifData = exif.getAttributes();
     exifData.put(GPSImgDirection,200);
     exif.saveAttributes(exifData);
     exif.commitChanges();

 On Jun 19, 8:24 pm, Augustin.CL iamaugus...@gmail.com wrote:



  Dear All,
          Currently, I want to fix the camera apk to make the image
  attached the GPS information. But I find there are some problems.
          1. First, we can't change the exif information. According 
  tohttp://code.google.com/p/android/issues/detail?id=2415, I modified
  some codes of libexif(external/jhead/main.c). Now, it will show the
  GPS information.

          2.But, when I try to modify the gps information of EXIF, I
  failed to update this information to that image.

  My questions is How I could use the ExifInterface.java of Camera app
  to change the Exif information.

  Please give me some advices. Thanks in advanced.

  BTW, Does ExifInterface.java use the android/external/jhead/main.c
  over JNI?

  Best regards,
  Augustin.- Hide quoted text -

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



[android-developers] Animation Transition

2009-06-23 Thread Sukitha Udugamasooriya

Hi all,

Can you advise me how to apply view transition animation.

ex: when i click on an list item my contentview changers. I want to
apply a transition animation in that.

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] ContentObserver _id - SMS, Contact Media

2009-06-23 Thread Shibbs

Hi All,

From the past two days I have been closely reading through the
ContentObserver discussion on the various scenarios like:
1.) SMS sent
2.) Contacts updated
3.) Media added.
4.) etc...

We all are aware that the onChange() of the ContentObserver() doesn't
notify us to what has been changed for obvious reasons.

We thought of coming up with a logic, though it is not fully proof,
just wanted to discuss the solution with you guys:

The scenarios we deal with here are:
1.) Last SMS Sent
2.) New Contacts added.

We had a close look at the db structure of the Contacts, SMS  Media.
They all have this primary column name - _id which is
autoincremental. Currently the limit of this stands at a whoofing:
9223372036854775807. (2^63)

each time a new contact has been added to contacts.db or new SMS sent
(record added to ( SMS db)) it is bound to have the greatest _id
value if the above limit (9223372036854775807)  has not been reached
yet.

Then in onChange()
1.) Filter out if the event is a new contact changed or SMS sent
{ simple logic posted in previous some post)
2.) If yes, then query and get the last record based on the ascending
order of _id value (default order) you can get the desired last SMS
sent or New contact added.

Note: This logic is not full proof, cause over a period of time if the
_id crosses 9223372036854775807, then this logic would fail or I
guess so.

Not sure what Android would do internally once the id crosses
9223372036854775807?
Will it start from -9223372036854775808.

Any better solution?


Thanks,
Shibbs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: drawRect not doing anything in a 1.5 MapView

2009-06-23 Thread MrChaz

You'll need to do fillPaint.setStyle(Paint.Style.FILL) I think.


On Jun 21, 7:57 pm, CaptainSpam captains...@gmail.com wrote:
 I'm having a problem getting drawRect to draw anything on a Canvas
 from a MapView (i.e. as an Overlay) on 1.5 firmware.  The strange
 thing is, drawLine is working perfectly, and both work right with the
 same code under 1.1.  Was there anything that changed in this respect
 between 1.1 and 1.5 I'm not taking into account?

 The relevant code is as follows (in snippet form):
 (R.color.graticule_fill is #10FF; Graticule is an object that
 indicates a 1x1 degree area on the earth's surface)

 Context mContext; // comes in from constructor

 static Paint fillPaint = new Paint();
 fillPaint.setColor(mContext.getResources().getColor
 (R.color.graticule_fill));

     protected void drawGraticuleFill(Canvas c, Projection pr,
 Graticule g) {
         // This method is called from draw(); c is passed in from
 there,
         // pr = mapView.getProjection(), g is provided by the class.
         if (g == null) {
             return;
         }

         // Two Points, the top-left and bottom-right of the graticule,
 taken from the
         // current Projection
         Point topleft = pr.toPixels(g.getTopLeftGeoPoint(), null);
         Point bottomright = pr.toPixels(g.getBottomRightGeoPoint(),
 null);

         // Should draw out a rectangle covering the graticule; this
 works in 1.1, but
         // doesn't seem to do anything in 1.5.
         c.drawRect(new Rect(topleft.x, topleft.y, bottomright.x,
 bottomright.y), fillPaint);
     }

 (sorry if this snippet doesn't make much sense out of context, I can
 provide more information if need be)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 g1's camera application from my application

2009-06-23 Thread gard

Maybe 
http://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE
will do the trick

On 22 Jun, 22:54, cindy ypu01...@yahoo.com wrote:
 Hi all,

 I want user to take picture using camera application. Then send the
 image to my application through share.

 Does anyone knows how to do that?

 Thanks!

 Cindy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Streaming on Android Phone?

2009-06-23 Thread javame_android

Hi,

The applet is using OpenGL API. Its developed using JOGL and it works
perfectly. Some part of the application has been ported to Android but
its slow. The hardware acceleration will come into play once the
rendering is started. But it gets slow when decoding of the file is
going on. Anyways will look into it.





Regards
Sunil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Where to store data

2009-06-23 Thread mf-team

Hi Marc,

thank you very much. You confirmed my suggestion.
Regards,
 MF

On Jun 22, 1:44 pm, Mark Murphy mmur...@commonsware.com wrote:
 mf-team wrote:
  i'm writing an application that needs to store some small jpeg or
  pngs. Looking at the documentation i have seen that databases are
  stored under /data/data/package_name/databases
  I decided to store my data under /data/data/package_name/files.
  With the emulator i can see all these files (databases and images)
  under the proposed directories but moving the application on a real
  device and installing a file system browser i cannot see any file
  under /data. Can anyone explain me why?

 Security.

  My application works perfectly on my mobile (HTC magic) so i think
  that data is downloaded and stored.
  If this is a security constraint, do i need to put the application
  under debug on the mobile in order to inspect file system?

 AFAIK, there is no way to inspect the file system on a normal (i.e.,
 non-rooted) production device. That means you cannot browse it with DDMS.

 At least for debug-compiled apps, I used to have success using adb pull
 to directly reference a file and download it off the device, though I
 haven't tried that since Android 1.5 was released.

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

 Looking for Android opportunties?http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread tstanly

hi all,

i have a app,the structure composed three .java,
1.java,2.java,3.java

their relationship is:
1-2-3
and 3 can go back to 1

when i was back to 1 from 3,
i want to close the 2,

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



[android-developers] Re: how to close activity?

2009-06-23 Thread Nithin Varamballi

Hi...

   When you are moving 1-2-3.. give finish() after start activity

ex:Intent intent = new Intent(java1.this, java2.class);
 startActivity(intent);
 finish();

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread tstanly

by the way,
not only close the 2,
but i want to kill the variables in the 2,

thanks!

On 6月23日, 下午5時25分, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 i have a app,the structure composed three .java,
 1.java,2.java,3.java

 their relationship is:
 1-2-3
 and 3 can go back to 1

 when i was back to 1 from 3,
 i want to close the 2,

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



[android-developers] Re: how to close activity?

2009-06-23 Thread tstanly

thanks for your reply,
but 3 back to 1 is optional,
so only 3 back to 1,2 will be kill.

and  also i want to kill the variables in 2...

On 6月23日, 下午5時31分, Nithin Varamballi nithi...@gmail.com wrote:
 Hi...

When you are moving 1-2-3.. give finish() after start activity

 ex:Intent intent = new Intent(java1.this, java2.class);
  startActivity(intent);
  finish();
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread Rock
 hi...

 kill the variables means...? can you give the
example...?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread Rock
hi...

 Can You update that code

Thank you
Rock

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread Nithin Varamballi

Hi...

  When you are moving 3-1.. give finish() after start activity

ex:Intent intent = new Intent(java3.this, java1.class);
startActivity(intent);
finish();

 When finish() called here java3 class will be destroy.

Thank You
Nithin N V

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread tstanly

i means,
3-1,and destroy 2,
so use finish(),you can destroy 3,
but you can't destroy 2

On 6月23日, 下午5時45分, Nithin Varamballi nithi...@gmail.com wrote:
 Hi...

   When you are moving 3-1.. give finish() after start activity

 ex:Intent intent = new Intent(java3.this, java1.class);
 startActivity(intent);
 finish();

  When finish() called here java3 class will be destroy.

 Thank You
 Nithin N V
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread tstanly

eg:
2.java has a variable s:
private String s;
i changed value probability,

but now,
when 3-1,i want to destroy 2 and kill variable s,
that means,
when back to 1 from 3,the s is null.

On 6月23日, 下午5時37分, Rock nithinvaramba...@gmail.com wrote:
  hi...

  kill the variables means...? can you give the
 example...?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread Rock
Hi...

  You are declared as private String s; So s variable cannot
access in 1.java 0r 3.java.. So
make the s variable declared as public static String s; So now you can
access variable in 1.java 0r 3.java
So assign value s=;

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] SoundPool doesn't play sounds 100K in SDK 1.5

2009-06-23 Thread Katsiaryna

Hello,

I am trying to use SoundPool class from the new SDK. However, I
discovered that if I load sounds that are 100K (120K and 350K) from
resources I have problems playing them. The error messages that I get
are as follows:

06-23 10:53:42.263: ERROR/AudioFlinger(35): not enough memory for
AudioTrack size=1048640
06-23 10:53:42.263: DEBUG/MemoryDealer(35):   AudioTrack (0x25018,
size=1048576)
06-23 10:53:42.263: DEBUG/MemoryDealer(35): 0: 0002aaf0 |
0x | 0x00090940 | A
06-23 10:53:42.263: DEBUG/MemoryDealer(35): 1: 0002ab78 |
0x00090940 | 0x0006F6C0 | F
06-23 10:53:42.263: DEBUG/MemoryDealer(35):   size allocated: 592192
(578 KB)

Consequently, the playback never starts.

Curiously, the numbers in the message do not seem to change with sound
files of different sizes: whether it is 120K or 350K, it always says
not enough memory for AudioTrack size=1048640. Also, when I load the
sounds I see numerous messages in the log saying 06-23 10:53:35.743:
ERROR/AudioCache(35): Heap size overflow! req size: 1052672, max size:
1048576.

So, is there any official size limit on the size of the files you
can play, or are there any settings to adjust to solve this problem?
The test application where I get this doesn't actually do anything
else but loads and tries to play these sounds, so I do not think that
it is the problem of it using too much memory overall. I also tried
both .ogg and .mp3 files - equally without any success.

Any help would be much appreciated,

---
Best regards,
Katsiaryna
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 a view from a custom layout ?

2009-06-23 Thread Guian

I've created a custom view via .xml file,
and I wanted to add it as a a contentView to an alert Dialog usinf a
dialogBuilder:


AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setNeutralButton( _Res.getString(R.string.close), new
DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
myDial.dismiss();
}
});
builder.setCancelable(true);
builder.setIcon(R.drawable.my_icon);
builder.setTitle(R.string.title);

builder.setView(   HERE I SHOULD USE myCustomLayout   );
builder.create();

TextView text = (TextView) myCustomLayout.findViewById(R.id.goTotext);
text.setText(toto);
... etc...

builder.show();



The problem is...  I can't get my view from my custom layout...
I only have an  id (int)...

I tried Resource.getLayout(int) = it returns an xmlParser... not very
usefull ...

finally the solution I comes up is so disgusting ( it worked but ...
let's have a look)

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setNeutralButton( _Res.getString(R.string.close), new
DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which) {
myDial.dismiss();
}
});
builder.setCancelable(true);
builder.setIcon(R.drawable.my_icon);
builder.setTitle(R.string.title);

Dialog tmpDial = new Dialog(this); // create a tmp dialog ...
tmpDial.setContentView(R.layout.settings_dialog); // put my
custom layout as the content view of the tmp Dialog

View tmp  = (View)tmpDial.findViewById(R.id.setting_dial_lay); //
get my layout as a View ...
tmpDial.setContentView(new View(this)); // set a new content
View to the tmp dial to remove my view from his parent... (so sad
isn't it ?)

builder.setView(tmp); / here I have my view ready to be used
but isn't it really disgusting ... ??
builder.create();



... so guys,  how can I do that easily without using such a disgusting
way... ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Drawing custom images in a ListView

2009-06-23 Thread Tez

Hi,

I would like to draw custom images within a ListView, for this I have
created a ListView and an ArrayAdapter object. I have specified that
each element of the ListView will be an ImageView which is specified
by an XML layout file. Now, I would like to draw a custom graphic in
each cell depending upon certain paramters. How do
i do this?

Cheers,
Earlence

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



[android-developers] Errors In Android Run time I need suggestions

2009-06-23 Thread android.vinny

HI everyone go through the attachment i have enclosed as attachment i
have captured the error what i git i need solution for this


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



[android-developers] No context menu on map view intended??

2009-06-23 Thread Binesy

Hi

Having been working with context menus with other views, which can be
done with

view.setLongClickable(true);
registerForContextMenu(view);

this does not seem to be the case with map view.  Is this intended??
Also overlays only seem to be able catch onTap events, is it possible
to catch long press events on these?

Many Thanks

Ross
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Drawing custom images in a ListView

2009-06-23 Thread Saurav Mukherjee
try this:
override the onDraw  method of the View... for this u need to extend a View.
add the object of this view to ur List...
hope this helps u.
cheers.

On Tue, Jun 23, 2009 at 4:20 PM, Tez earlencefe...@gmail.com wrote:


 Hi,

 I would like to draw custom images within a ListView, for this I have
 created a ListView and an ArrayAdapter object. I have specified that
 each element of the ListView will be an ImageView which is specified
 by an XML layout file. Now, I would like to draw a custom graphic in
 each cell depending upon certain paramters. How do
 i do this?

 Cheers,
 Earlence

 


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



[android-developers] quoted printable decoder api on Android?

2009-06-23 Thread sukumar

hi,

Was there any apis available on android for quoted printable
decoding ?. Thanks.

Regards,
Sukumar.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: No one ever answer my posts !!!!

2009-06-23 Thread Mark Murphy

http://androidguys.com/?p=5738

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

Android Development Wiki: http://wiki.andmob.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Errors In Android Run time I need suggestions

2009-06-23 Thread Urs Grob

There's a NullPointerException on line 31 in org.tuxpan.Adder ... in
the method onCreate. That's the cause for the RuntimeException being
thrown.

-- Urs

On Tue, Jun 23, 2009 at 12:54 PM, Desu Vinod Kumarvinny.s...@gmail.com wrote:


 On Tue, Jun 23, 2009 at 4:23 PM, android.vinny vinny.s...@gmail.com wrote:

 HI everyone go through the attachment i have enclosed as attachment i
 have captured the error what i git i need solution for this


 Thanks in advance




 --
 Regards
 ---
 Desu Vinod Kumar
 vinny.s...@gmail.com
 09916009493

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Errors In Android Run time I need suggestions

2009-06-23 Thread Desu Vinod Kumar
Hi

thanks for giving response

How to clear that i am not getting this is my code

package org.tuxpan;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.app.Activity;
import android.view.View;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;



public class Adder extends Activity
{
private static final String SOAP_ACTION = AddIntegers;
private static final String METHOD_NAME = AddIntegers;
private static final String NAMESPACE = http://services.o2;;
private static final String URL = 
http://wiki.tuxpan.com:8069/axis2/services/Simple;;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);

setContentView(R.layout.main);
findViewById(R.id.cmdCalculate).setOnClickListener(new
OnClickListener() {
public void onClick(View view)
{
((TextView)findViewById(R.id.lblStatus)).setText(...
Invoking Web Service ...);
String stA =
((EditText)findViewById(R.id.numberA)).getText().toString();
String stB =
((EditText)findViewById(R.id.numberB)).getText().toString();
Integer a = null;
Integer b = null;
try {
a = Integer.valueOf(stA);
b = Integer.valueOf(stB);
} catch(Exception e1) {
}
if (a == null || b == null) {
((TextView)findViewById(R.id.lblStatus)).setText(Only
Integer numbers please...);
}
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject inAddIntegers = new SoapObject(NAMESPACE,
InAddIntegers);
inAddIntegers.addProperty(a, a);
inAddIntegers.addProperty(b, b);
request.addProperty(InAddIntegers, inAddIntegers);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
AndroidHttpTransport androidHttpTransport = new
AndroidHttpTransport (URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
Object result = envelope.getResponse();

((TextView)findViewById(R.id.lblStatus)).setText(result.toString());
} catch(Exception E) {

((TextView)findViewById(R.id.lblStatus)).setText(ERROR: +
E.getClass().getName() + :  + E.getMessage());
}
}
});
}
}

On Tue, Jun 23, 2009 at 4:42 PM, Urs Grob grob@gmail.com wrote:


 There's a NullPointerException on line 31 in org.tuxpan.Adder ... in
 the method onCreate. That's the cause for the RuntimeException being
 thrown.

 -- Urs

 On Tue, Jun 23, 2009 at 12:54 PM, Desu Vinod Kumarvinny.s...@gmail.com
 wrote:
 
 
  On Tue, Jun 23, 2009 at 4:23 PM, android.vinny vinny.s...@gmail.com
 wrote:
 
  HI everyone go through the attachment i have enclosed as attachment i
  have captured the error what i git i need solution for this
 
 
  Thanks in advance
 
 
 
 
  --
  Regards
  ---
  Desu Vinod Kumar
  vinny.s...@gmail.com
  09916009493
 
  
 

 



-- 
Regards
---
Desu Vinod Kumar
vinny.s...@gmail.com
09916009493

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Errors In Android Run time I need suggestions

2009-06-23 Thread Urs Grob

Ok ..counting by hand I think this is the 31st line:
findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() {

So I guess findViewById(R.id.cmdCalculate) returns null.

Is there a definition for cmdCalculate in your main layout? (if there
is, there's maybe a typo?)

-- Urs

On Tue, Jun 23, 2009 at 1:15 PM, Desu Vinod Kumarvinny.s...@gmail.com wrote:
 Hi

 thanks for giving response

 How to clear that i am not getting this is my code

 package org.tuxpan;

 import org.ksoap2.SoapEnvelope;
 import org.ksoap2.serialization.SoapObject;
 import org.ksoap2.serialization.SoapSerializationEnvelope;
 import org.ksoap2.transport.AndroidHttpTransport;

 import android.app.Activity;
 import android.view.View;
 import android.os.Bundle;
 import android.view.View.OnClickListener;
 import android.widget.EditText;
 import android.widget.TextView;



 public class Adder extends Activity
 {
 private static final String SOAP_ACTION = AddIntegers;
 private static final String METHOD_NAME = AddIntegers;
 private static final String NAMESPACE = http://services.o2;;
 private static final String URL =
 http://wiki.tuxpan.com:8069/axis2/services/Simple;;

 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle icicle)
 {
 super.onCreate(icicle);

 setContentView(R.layout.main);
 findViewById(R.id.cmdCalculate).setOnClickListener(new
 OnClickListener() {
 public void onClick(View view)
 {
 ((TextView)findViewById(R.id.lblStatus)).setText(...
 Invoking Web Service ...);
 String stA =
 ((EditText)findViewById(R.id.numberA)).getText().toString();
 String stB =
 ((EditText)findViewById(R.id.numberB)).getText().toString();
 Integer a = null;
 Integer b = null;
 try {
 a = Integer.valueOf(stA);
 b = Integer.valueOf(stB);
 } catch(Exception e1) {
 }
 if (a == null || b == null) {
 ((TextView)findViewById(R.id.lblStatus)).setText(Only
 Integer numbers please...);
 }
 SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
 SoapObject inAddIntegers = new SoapObject(NAMESPACE,
 InAddIntegers);
 inAddIntegers.addProperty(a, a);
 inAddIntegers.addProperty(b, b);
 request.addProperty(InAddIntegers, inAddIntegers);
 SoapSerializationEnvelope envelope = new
 SoapSerializationEnvelope(SoapEnvelope.VER11);
 envelope.setOutputSoapObject(request);
 AndroidHttpTransport androidHttpTransport = new
 AndroidHttpTransport (URL);
 try {
 androidHttpTransport.call(SOAP_ACTION, envelope);
 Object result = envelope.getResponse();

 ((TextView)findViewById(R.id.lblStatus)).setText(result.toString());
 } catch(Exception E) {

 ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: +
 E.getClass().getName() + :  + E.getMessage());
 }
 }
 });
 }
 }

 On Tue, Jun 23, 2009 at 4:42 PM, Urs Grob grob@gmail.com wrote:

 There's a NullPointerException on line 31 in org.tuxpan.Adder ... in
 the method onCreate. That's the cause for the RuntimeException being
 thrown.

 -- Urs

 On Tue, Jun 23, 2009 at 12:54 PM, Desu Vinod Kumarvinny.s...@gmail.com
 wrote:
 
 
  On Tue, Jun 23, 2009 at 4:23 PM, android.vinny vinny.s...@gmail.com
  wrote:
 
  HI everyone go through the attachment i have enclosed as attachment i
  have captured the error what i git i need solution for this
 
 
  Thanks in advance
 
 
 
 
  --
  Regards
  ---
  Desu Vinod Kumar
  vinny.s...@gmail.com
  09916009493
 
  
 





 --
 Regards
 ---
 Desu Vinod Kumar
 vinny.s...@gmail.com
 09916009493

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Cannot get Log.isLoggable working as documented

2009-06-23 Thread mjc147

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



[android-developers] Re: Binder Thread issue.

2009-06-23 Thread Mike Hearn

They're used by the framework itself, ignore them.

On Jun 23, 6:59 am, Gavin fjm...@gmail.com wrote:
      My app have a service and it will create a thread every 5 mins.
 The thread will connect internet to download some data, and then exit.

That's not the right design. Instead look into the alarm manager, you
want an inexact repeating alarm to send an intent to your service so
your process only runs when it's actually working. Make sure that
stopSelf() is always called, even if the process is killed half way
through the download!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Drawing custom images in a ListView

2009-06-23 Thread Mark Murphy

Tez wrote:
 Hi,
 
 I would like to draw custom images within a ListView, for this I have
 created a ListView and an ArrayAdapter object. I have specified that
 each element of the ListView will be an ImageView which is specified
 by an XML layout file. Now, I would like to draw a custom graphic in
 each cell depending upon certain paramters. How do
 i do this?

Visit:

http://wiki.andmob.org/samplecode

and scroll down to find links to my several-post Fancy ListViews series.
The code is mostly from last summer's M5 SDK, and so these posts are a
bit dated, but the techniques still work. Oh, and please forgive the
post formatting.

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

_Android Programming Tutorials_ Version 1.0 Available!

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



[android-developers] Re: How to get a view from a custom layout ?

2009-06-23 Thread Mark Murphy

Guian wrote:
 I've created a custom view via .xml file,
 and I wanted to add it as a a contentView to an alert Dialog usinf a
 dialogBuilder:
 
 
 AlertDialog.Builder builder = new AlertDialog.Builder(this);
 builder.setNeutralButton( _Res.getString(R.string.close), new
 DialogInterface.OnClickListener(){
   public void onClick(DialogInterface dialog, int which) {
   myDial.dismiss();
   }
 });
 builder.setCancelable(true);
   builder.setIcon(R.drawable.my_icon);
   builder.setTitle(R.string.title);
 
   builder.setView(   HERE I SHOULD USE myCustomLayout   );
   builder.create();
 
 TextView text = (TextView) myCustomLayout.findViewById(R.id.goTotext);
 text.setText(toto);
 ... etc...
 
 builder.show();
 
 
 
 The problem is...  I can't get my view from my custom layout...
 I only have an  id (int)...
 
 I tried Resource.getLayout(int) = it returns an xmlParser... not very
 usefull ...
 
 finally the solution I comes up is so disgusting ( it worked but ...
 let's have a look)
 
 AlertDialog.Builder builder = new AlertDialog.Builder(this);
 builder.setNeutralButton( _Res.getString(R.string.close), new
 DialogInterface.OnClickListener(){
   public void onClick(DialogInterface dialog, int which) {
   myDial.dismiss();
   }
 });
 builder.setCancelable(true);
   builder.setIcon(R.drawable.my_icon);
   builder.setTitle(R.string.title);
 
   Dialog tmpDial = new Dialog(this); // create a tmp dialog ...
   tmpDial.setContentView(R.layout.settings_dialog); // put my
 custom layout as the content view of the tmp Dialog
 
   View tmp  = (View)tmpDial.findViewById(R.id.setting_dial_lay); //
 get my layout as a View ...
   tmpDial.setContentView(new View(this)); // set a new content
 View to the tmp dial to remove my view from his parent... (so sad
 isn't it ?)
 
   builder.setView(tmp); / here I have my view ready to be used
 but isn't it really disgusting ... ??
   builder.create();
 
 
 
 ... so guys,  how can I do that easily without using such a disgusting
 way... ?

Use LayoutInflater, obtained via getLayoutInflater() from your Activity.

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

_Android Programming Tutorials_ Version 1.0 Available!

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



[android-developers] Re: Errors In Android Run time I need suggestions

2009-06-23 Thread Desu Vinod Kumar
Hi

Yes absolutly correct that cmdcalculate button invoking webservices when i
press that button it is quitting

i am not getting how to solve
this


On Tue, Jun 23, 2009 at 4:51 PM, Urs Grob grob@gmail.com wrote:


 Ok ..counting by hand I think this is the 31st line:
 findViewById(R.id.cmdCalculate).setOnClickListener(new OnClickListener() {

 So I guess findViewById(R.id.cmdCalculate) returns null.

 Is there a definition for cmdCalculate in your main layout? (if there
 is, there's maybe a typo?)

 -- Urs

 On Tue, Jun 23, 2009 at 1:15 PM, Desu Vinod Kumarvinny.s...@gmail.com
 wrote:
  Hi
 
  thanks for giving response
 
  How to clear that i am not getting this is my code
 
  package org.tuxpan;
 
  import org.ksoap2.SoapEnvelope;
  import org.ksoap2.serialization.SoapObject;
  import org.ksoap2.serialization.SoapSerializationEnvelope;
  import org.ksoap2.transport.AndroidHttpTransport;
 
  import android.app.Activity;
  import android.view.View;
  import android.os.Bundle;
  import android.view.View.OnClickListener;
  import android.widget.EditText;
  import android.widget.TextView;
 
 
 
  public class Adder extends Activity
  {
  private static final String SOAP_ACTION = AddIntegers;
  private static final String METHOD_NAME = AddIntegers;
  private static final String NAMESPACE = http://services.o2;;
  private static final String URL =
  http://wiki.tuxpan.com:8069/axis2/services/Simple;;
 
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle icicle)
  {
  super.onCreate(icicle);
 
  setContentView(R.layout.main);
  findViewById(R.id.cmdCalculate).setOnClickListener(new
  OnClickListener() {
  public void onClick(View view)
  {
  ((TextView)findViewById(R.id.lblStatus)).setText(...
  Invoking Web Service ...);
  String stA =
  ((EditText)findViewById(R.id.numberA)).getText().toString();
  String stB =
  ((EditText)findViewById(R.id.numberB)).getText().toString();
  Integer a = null;
  Integer b = null;
  try {
  a = Integer.valueOf(stA);
  b = Integer.valueOf(stB);
  } catch(Exception e1) {
  }
  if (a == null || b == null) {
 
 ((TextView)findViewById(R.id.lblStatus)).setText(Only
  Integer numbers please...);
  }
  SoapObject request = new SoapObject(NAMESPACE,
 METHOD_NAME);
  SoapObject inAddIntegers = new SoapObject(NAMESPACE,
  InAddIntegers);
  inAddIntegers.addProperty(a, a);
  inAddIntegers.addProperty(b, b);
  request.addProperty(InAddIntegers, inAddIntegers);
  SoapSerializationEnvelope envelope = new
  SoapSerializationEnvelope(SoapEnvelope.VER11);
  envelope.setOutputSoapObject(request);
  AndroidHttpTransport androidHttpTransport = new
  AndroidHttpTransport (URL);
  try {
  androidHttpTransport.call(SOAP_ACTION, envelope);
  Object result = envelope.getResponse();
 
  ((TextView)findViewById(R.id.lblStatus)).setText(result.toString());
  } catch(Exception E) {
 
  ((TextView)findViewById(R.id.lblStatus)).setText(ERROR: +
  E.getClass().getName() + :  + E.getMessage());
  }
  }
  });
  }
  }
 
  On Tue, Jun 23, 2009 at 4:42 PM, Urs Grob grob@gmail.com wrote:
 
  There's a NullPointerException on line 31 in org.tuxpan.Adder ... in
  the method onCreate. That's the cause for the RuntimeException being
  thrown.
 
  -- Urs
 
  On Tue, Jun 23, 2009 at 12:54 PM, Desu Vinod Kumarvinny.s...@gmail.com
 
  wrote:
  
  
   On Tue, Jun 23, 2009 at 4:23 PM, android.vinny vinny.s...@gmail.com
   wrote:
  
   HI everyone go through the attachment i have enclosed as attachment i
   have captured the error what i git i need solution for this
  
  
   Thanks in advance
  
  
  
  
   --
   Regards
   ---
   Desu Vinod Kumar
   vinny.s...@gmail.com
   09916009493
  
   
  
 
 
 
 
 
  --
  Regards
  ---
  Desu Vinod Kumar
  vinny.s...@gmail.com
  09916009493
 
  
 

 



-- 
Regards
---
Desu Vinod Kumar
vinny.s...@gmail.com
09916009493

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ContentObserver _id - SMS, Contact Media

2009-06-23 Thread Peli

Don't worry about reaching the limit 9223372036854775807.

Even if you insert 1000 new entries per second into your database, it
will take you 290 million years until you reach that limit
( 9223372036854775807 / 1000 / 60 / 60 / 24 / 365 = 292 471 209 )

(dinosaurs died out 65 million years ago; the G1 would be a fossil by
that time: 
http://news.softpedia.com/news/The-Oldest-Fossil-Russian-Doll-290-Million-Years-Old-70431.shtml
)

Peli
www.openintents.org
www.openintents.biz/obscura.html

On Jun 23, 9:45 am, Shibbs shibu.deva...@gmail.com wrote:
 Hi All,

 From the past two days I have been closely reading through the
 ContentObserver discussion on the various scenarios like:
 1.) SMS sent
 2.) Contacts updated
 3.) Media added.
 4.) etc...

 We all are aware that the onChange() of the ContentObserver() doesn't
 notify us to what has been changed for obvious reasons.

 We thought of coming up with a logic, though it is not fully proof,
 just wanted to discuss the solution with you guys:

 The scenarios we deal with here are:
 1.) Last SMS Sent
 2.) New Contacts added.

 We had a close look at the db structure of the Contacts, SMS  Media.
 They all have this primary column name - _id which is
 autoincremental. Currently the limit of this stands at a whoofing:
 9223372036854775807. (2^63)

 each time a new contact has been added to contacts.db or new SMS sent
 (record added to ( SMS db)) it is bound to have the greatest _id
 value if the above limit (9223372036854775807)  has not been reached
 yet.

 Then in onChange()
 1.) Filter out if the event is a new contact changed or SMS sent
 { simple logic posted in previous some post)
 2.) If yes, then query and get the last record based on the ascending
 order of _id value (default order) you can get the desired last SMS
 sent or New contact added.

 Note: This logic is not full proof, cause over a period of time if the
 _id crosses 9223372036854775807, then this logic would fail or I
 guess so.

 Not sure what Android would do internally once the id crosses
 9223372036854775807?
 Will it start from -9223372036854775808.

 Any better solution?

 Thanks,
 Shibbs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 stay animation result in view?

2009-06-23 Thread shleeforandroid

hi guys !

I tried to implement the app like roulette to use RotateAnimation.

The arrow must indicate random direction but the arrow always indicate
the same(first direction) direction behind the end of RotateAnimation.

are there any ways to hold down random direction?

I want to know how to hold down the last animation result after
animation runs.

Thanks for your help.!!








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



[android-developers] Re: Animation Transition

2009-06-23 Thread Peli

Have you looked into the API demo examples?

Peli
www.openintents.org

On Jun 23, 9:39 am, Sukitha Udugamasooriya suk...@gmail.com wrote:
 Hi all,

 Can you advise me how to apply view transition animation.

 ex: when i click on an list item my contentview changers. I want to
 apply a transition animation in that.

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



[android-developers] Re: Problem with setExtra

2009-06-23 Thread Peli

Did you make sure the first argument of putExtra(..), that is your
variable intStringName, is not null?

Peli
www.openintents.org

On Jun 23, 4:24 am, Will wbc...@gmail.com wrote:
 Sorry, I wasn't clear. That putExtra call actually crashes the
 program, which is why I'm so stumped. Why would a putExtra() call
 crash the 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] Re: how can i launch the intent to pick image from SD card?

2009-06-23 Thread Peli

I presume the video list activity has not been implemented
cooperatively enough for  ACTION_PICK.

An alternative is to try to use ACTION_GET_CONTENT, which is taken
better care of usually.

Peli
www.openintents.org

On Jun 22, 8:25 pm, silverburgh silverburgh.me...@gmail.com wrote:
 Thank you. I have tried to do the same thing for picking a video:

         startActivityForResult( new Intent(Intent.ACTION_PICK,
                                  
 android.provider.MediaStore.Video.Media.INTERNAL_CONTENT_URI),
                                 PICK_VIDEO);

 But I only get a listView which shows the text of the video file name.
 And when I click on it, the video plays.

 How can i get it to show a 'preview thumbmail' of each video? (like of
 like how Gallery 'Select Video' works)? And when I click on it, the
 video is selected , instead of playing it?

 Thank you again.

 On Sat, Jun 13, 2009 at 11:40 AM, Markclosecr...@riven.tzo.com wrote:

  I think you might want something like this:

  // start the image picker activity - the 999 is just a unique request
  code
  startActivityForResult( new Intent(Intent.ACTION_PICK,
   android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),
  999);

  at this point, the Gallery app will start and your app will pause

  To get the results (the selected image):

  // meanwhile, back in your activity...
  protected final void onActivityResult(final int requestCode, final int
  resultCode, final Intent i) {
         super.onActivityResult(requestCode, resultCode, i);

   // this matches the request code in the above call
   if (requestCode == 999) {
     Uri _uri = i.getData();

     // this will be null if no image was selected...
     if (_uri != null) {
       // now we get the path to the image file
       cursor = getContentResolver().query(_uri, new String[]
  { android.provider.MediaStore.Images.ImageColumns.DATA },
                                           null, null, null);
       cursor.moveToFirst();
       String imageFilePath = cursor.getString(0);
       cursor.close();
     }
   }

  this will give you the absolute path to the selected image file.

  On Jun 13, 12:26 am, Meryl Silverburgh silverburgh.me...@gmail.com
  wrote:
  Hi,

  Can you please tell me how can i launch the intent to pick image from SD 
  card?
  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] Problem with a AndroidManifest.xml for a service

2009-06-23 Thread GAYET Thierry
Hello,

I have used the Eclipse IDE for starting an Android Service but i have one 
problem with my AndroidManifest.xml file on the line of the service tag.

Here is my AndroidManifest.xml :



package=com.OrangeLabs.gbaAndroid.BootstrapService
application
activity class=.BootstrapService android:label=@string/app_name
intent-filter
action android:value=android.intent.action.MAIN /
category android:value=android.intent.category.LAUNCHER /
/intent-filter
/activity
   service class=”.BootstrapService”/ -- my problem is here !!
/application
/manifest 

And my Service skeleton :


package com.OrangeLabs.gbaAndroid.BootstrapService;


import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.os.Parcel;
import android.widget.Toast;

//Need the following import to get access to the app resources, since this
//class is in a sub-package.
import com.OrangeLabs.gbaAndroid.BootstrapService.R;

// @brief Main class for the BootstrapService Android service
public class BootstrapService extends Service 
{
// Actions to perform when service is started.
@Override
public void onStart(Intent intent, int startId)
{
// Test the TelephonyManager API (can we have an access to the 
authenfication
// function buildin the sim/usim card



// Create the shared memory used between the bootstrap client and the 
// application in link with a NAF server

// Check and wait until the WIFI become usable


} // onStart

// Initialize variables, get references to GUI objects
@Override
public void onCreate()
{



} // onCreate
@Override
public IBinder onBind(Intent intent) 
{


return null;
} // onBind
} // BootstrapService



Is there a place where i can view / download some services sample ? 

Regards


Thierry GAYET
NextInnovation.org
+33(0)663.849.589



  
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Use own map layer in Google Maps

2009-06-23 Thread JP

Hi All,

I have a GIS layer, that holds information about some areas. It is
basically a rating for a specic area. So each shape defines a specific
rating.

I would like to be able to add this layer to Google Maps and then in
my Google Android phone be able to open a little application that just
shows that rating based on your current location as a big number on
the screen.

I am fairly new to Android development, so I don't know the Google
Maps API that well yet.

I would be very happy for any pointers in the right direction and even
happier if anyone could present an example!

Thanks,
JP
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Problem with a AndroidManifest.xml for a service

2009-06-23 Thread Mark Murphy

GAYET Thierry wrote:
 Is there a place where i can view / download some services sample ?

There are samples in the SDK:

http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/app/index.html

You can also find sample services in (*cough*) any decent Android book. ;-)

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

_Android Programming Tutorials_ Version 1.0 Available!

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



[android-developers] sample browser plugin not working in android sdk emulator

2009-06-23 Thread Kathick

Hi All,

 My sample browser plugin working in emulator which is being built
from mydroid package(Android source pakage). The same library is  not
working in android sdk emulator(The sdk version is 1.1).

Please tell me the reason for this. How can I make it work in
emulator coming up with sdk.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Eficient way to call an Activity

2009-06-23 Thread RS.Giridaran

Hi All,

I am developing a android application with more than four activities.
i am starting a activity using startActrivity() method wherever i need
to go for other activity. i feel this degrade my application
performance..

please advice me on this

Thanks,
Giri


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 change AlertDialog width

2009-06-23 Thread tstanly

hi all,

i use the android.app.AlertDialog.Builder to insert a AlertDialog,
but i can't change the width or word's format in the AlertDialog
items,

the reference is:
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setView(android.view.View)



how can 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] Re: Sending file via FTP within android

2009-06-23 Thread lucj06

Thanks Mark,
I'll check that.
Regards,
Luc

On Jun 22, 4:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 lucj06 wrote:
  Hello,
  In fact i was talking about the possibility to send a file via FTP
  from android.
  I just added andFTP in the picture as I read this client was good.
  Without talking about andFTP, are there any means to send a file via
  FTP ?

 Not built in, no. Your choices are to try a Java FTP JAR, or see if
 andFTP supports some sort of remote service API.

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

 Android Development Wiki:http://wiki.andmob.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ContentObserver _id - SMS, Contact Media

2009-06-23 Thread Shibbs

Thanks peli - My bad, should have calculated that the limit is
practically unreachable - (but always had a feeling what if.
sometimes too logical thinking is bad :) )
Anyways, in that case the above solution is full proof  good to go. I
have already implemented  it works smooth for Contacts, SMS  Media.

Hope it helps someone!

Thanks,
Shibbs

On Jun 23, 5:18 pm, Peli peli0...@googlemail.com wrote:
 Don't worry about reaching the limit 9223372036854775807.

 Even if you insert 1000 new entries per second into your database, it
 will take you 290 million years until you reach that limit
 ( 9223372036854775807 / 1000 / 60 / 60 / 24 / 365 = 292 471 209 )

 (dinosaurs died out 65 million years ago; the G1 would be a fossil by
 that 
 time:http://news.softpedia.com/news/The-Oldest-Fossil-Russian-Doll-290-Mil...
 )

 Peliwww.openintents.orgwww.openintents.biz/obscura.html

 On Jun 23, 9:45 am, Shibbs shibu.deva...@gmail.com wrote:

  Hi All,

  From the past two days I have been closely reading through the
  ContentObserver discussion on the various scenarios like:
  1.) SMS sent
  2.) Contacts updated
  3.) Media added.
  4.) etc...

  We all are aware that the onChange() of the ContentObserver() doesn't
  notify us to what has been changed for obvious reasons.

  We thought of coming up with a logic, though it is not fully proof,
  just wanted to discuss the solution with you guys:

  The scenarios we deal with here are:
  1.) Last SMS Sent
  2.) New Contacts added.

  We had a close look at the db structure of the Contacts, SMS  Media.
  They all have this primary column name - _id which is
  autoincremental. Currently the limit of this stands at a whoofing:
  9223372036854775807. (2^63)

  each time a new contact has been added to contacts.db or new SMS sent
  (record added to ( SMS db)) it is bound to have the greatest _id
  value if the above limit (9223372036854775807)  has not been reached
  yet.

  Then in onChange()
  1.) Filter out if the event is a new contact changed or SMS sent
  { simple logic posted in previous some post)
  2.) If yes, then query and get the last record based on the ascending
  order of _id value (default order) you can get the desired last SMS
  sent or New contact added.

  Note: This logic is not full proof, cause over a period of time if the
  _id crosses 9223372036854775807, then this logic would fail or I
  guess so.

  Not sure what Android would do internally once the id crosses
  9223372036854775807?
  Will it start from -9223372036854775808.

  Any better solution?

  Thanks,
  Shibbs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: SoundPool doesn't play sounds 100K in SDK 1.5

2009-06-23 Thread Marco Nelissen
On Tue, Jun 23, 2009 at 3:11 AM, Katsiaryna katsiaryna.nali...@ndrc.iewrote:


 Hello,

 I am trying to use SoundPool class from the new SDK. However, I
 discovered that if I load sounds that are 100K (120K and 350K) from
 resources I have problems playing them. The error messages that I get
 are as follows:

 06-23 10:53:42.263: ERROR/AudioFlinger(35): not enough memory for
 AudioTrack size=1048640
 06-23 10:53:42.263: DEBUG/MemoryDealer(35):   AudioTrack (0x25018,
 size=1048576)
 06-23 10:53:42.263: DEBUG/MemoryDealer(35): 0: 0002aaf0 |
 0x | 0x00090940 | A
 06-23 10:53:42.263: DEBUG/MemoryDealer(35): 1: 0002ab78 |
 0x00090940 | 0x0006F6C0 | F
 06-23 10:53:42.263: DEBUG/MemoryDealer(35):   size allocated: 592192
 (578 KB)

 Consequently, the playback never starts.

 Curiously, the numbers in the message do not seem to change with sound
 files of different sizes: whether it is 120K or 350K, it always says
 not enough memory for AudioTrack size=1048640. Also, when I load the
 sounds I see numerous messages in the log saying 06-23 10:53:35.743:
 ERROR/AudioCache(35): Heap size overflow! req size: 1052672, max size:
 1048576.

 So, is there any official size limit on the size of the files you
 can play, or are there any settings to adjust to solve this problem?
 The test application where I get this doesn't actually do anything
 else but loads and tries to play these sounds, so I do not think that
 it is the problem of it using too much memory overall. I also tried
 both .ogg and .mp3 files - equally without any success.


That 120KB mp3 is decoded in to memory by SoundPool, and will expand to
something much bigger.
The exact numbers depend on the bitrate, sample rate and number of channels,
but as an example, a 100KB, 128kbit mp3 has a playback time of over 7
seconds, and if it's 44KHz stereo it will be about 1.3 megabyte when
decoded.
SoundPool is meant for short, sound effect style sounds that require very
low latency and low CPU overhead. For longer sounds, you should use
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] Re: how to close activity?

2009-06-23 Thread Marco Nelissen
To close 2 when going from 3 to 1, use the CLEAR_TOP flag in
startActivity().
To kill the variables, just set them to null in the activity's onDestroy.


2009/6/23 tstanly tsai.sta...@gmail.com


 by the way,
 not only close the 2,
 but i want to kill the variables in the 2,

 thanks!

 On 6月23日, 下午5時25分, tstanly tsai.sta...@gmail.com wrote:
  hi all,
 
  i have a app,the structure composed three .java,
  1.java,2.java,3.java
 
  their relationship is:
  1-2-3
  and 3 can go back to 1
 
  when i was back to 1 from 3,
  i want to close the 2,
 
  how to do this?
  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: Reading a large url

2009-06-23 Thread bsbi...@googlemail.com

Anyone got any ideas?

On Jun 23, 8:07 am, bsbi...@googlemail.com bsbi...@googlemail.com
wrote:
 Hi,

 The example I posted is a cut down version.

 In the real example the inputstream is passed as a argument to the sax
 parser.

 I just wanted to show that the

  String line = buff.readLine();
                         System.out.println(line);
                         while (line != null) {
                                 line = buff.readLine();
                                 System.out.println(line);
                         }

 Does not read the whole rss.xml on the HTC android phone

 On Jun 22, 5:05 pm, Marco Nelissen marc...@android.com wrote:



  On Mon, Jun 22, 2009 at 5:09 AM, bsbi...@googlemail.com 

  bsbi...@googlemail.com wrote:

   Hello,

   I am reading the following URL to test a RSS parser.

  http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xm

   When using the same code on a Android HTC phone the whole resource
   cannot be read. There are no exceptions being thrown. I am guessing
   the rss.xml is too large to be read in?

   I use a sax parser after the block of code which complains.

  Complains about what? The code you posted tries to read the entire file and
  dumps it to stdout, which means that even you passed the input stream to the
  parser (which the code you posted doesn't do, since the input stream object
  has limited scope), there would not be anything left for it to read.

                  try {
                          InputStream urlInputStream = null;

                          URL url = new URL(http://newsrss.bbc.co.uk/rss/
   newsonline_uk_edition/uk/rss.xmlhttp://newsrss.bbc.co.uk/rss/%0Anewsonline_uk_edition/uk/rss.xml
   );

                          BufferedReader buff = new BufferedReader(new
   InputStreamReader
   (url.openStream()));

                          String line = buff.readLine();
                          System.out.println(line);

                          while (line != null) {
                                  line = buff.readLine();
                                  System.out.println(line);
                          }

                          if (urlInputStream != null) {
                                  urlInputStream.close();
                          }
                  } catch (MalformedURLException e) {
                          e.printStackTrace();
                  } catch (IOException e) {
                          e.printStackTrace();
                  }
          }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: 6502 Emulator

2009-06-23 Thread LouisB

fadden, thanks for taking a looksy into the emulator.  Great ideas for
optimization BTW.  I've been looking at your ideas plus this document
(http://slack.net/~ant/nes-emu/6502.html) and wondering how much mhz I
can squeeze out of her.

 How are you determining performance?
Mhz is calculated by counting clock cycles per loop.

Might be pessimistic, but I'm thinking the G1 hardware is just too
slow.  It's at 1/3 mhz right now, and even if I squeeze another 1/3rd
out I'm still at .66Mhz.  The last 1/3 would probably be more trouble
than the time is worth (or impossible.)  I'm leaning heavily towards
waiting for the hardware to catch up.

Do you know anything about the NDK?  Would it allow me to do C
language type operations to speed this up?  i.e. get the JVM out of
the way and go straight to the cpu / memory?

 BTW, at some point you'll want to add support for a virtual keyboard.
 Not all devices have physical keyboards, which makes it tough to get
 things going.

True - I could use the built in one correct?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Eficient way to call an Activity

2009-06-23 Thread Marco Nelissen
On Tue, Jun 23, 2009 at 7:00 AM, RS.Giridaran rsgirida...@gmail.com wrote:


 Hi All,

 I am developing a android application with more than four activities.
 i am starting a activity using startActrivity() method wherever i need
 to go for other activity. i feel this degrade my application
 performance..


You mean you think that this *might* have a performance impact, or do you
have hard numbers showing that it impacts performance?

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



[android-developers] the url input in EditText problem for my browser

2009-06-23 Thread tstanly

hi all,

i use the webkit and the EditText to compose my browser,
when i key url in my EditText,
if the url is too long, it will continue in the next line,

i want to my input url area like ie or firefox,
if the word is too long,always in one line..

how to do this?

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: Use own map layer in Google Maps

2009-06-23 Thread Maps.Huge.Info (Maps API Guru)

You could call a Google API based map that uses a custom tile layer or
other type of overlay as a webkit page directly from an Android
application. The easiest way to do so would be to use a parameter
based positioning method, another words, pass the coordinates of
interest to the map via lat and lng parameters to the page. It's not
too hard to do this, nor is it too difficult to create a page with a
custom tile overlay, putting it all together requires a lot of little
things so if you're new to both Android and Google Maps API, then
figure at least a month or two of hard work to understand the dozen or
so pieces of the puzzle.

Here's a link to a parameter based map that essentially does what
you're looking to do with a whole image overlay instead of a custom
tile layer.

http://www.usnaviguide.com/v3maps/WhatZipCode.htm?lat=38lng=-123

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



[android-developers] Re: PMD Android ruleset

2009-06-23 Thread www.rzr.online.fr


On Jun 2, 8:50 pm, Fred Grott(shareme) fred.gr...@gmail.com wrote:
 I am extending the PMD ruleset used in AndCooper to cover more:
[...]
 Any more issues you see that should be a PMD rule?

Do you manage to generate reports ?
Feel free to submit your rule on pmd tracker :
https://sourceforge.net/tracker/?group_id=56262atid=479923

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] Access to cookies managed by Browser app

2009-06-23 Thread Tom

Hi,

Is it possible to access cookies managed by the Browser app (i.e. not
a custom WebView)?  If so, how?

Thanks!
Tom.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Copy SQL lite Database to Device (and not emulator)

2009-06-23 Thread burton miller

you can export it to file, then read that file in at run time.

however, if you are going to package the data with the app, i
recommend just putting the database in your assets, and copying it to
the database directory when you start up.  it won't take long
(compared to downloading from the net), and it is easier.  either way,
you waste the space.

how big is your db?

On Jun 21, 12:52 pm, Georgy georgearna...@gmail.com wrote:
 How can I dump my database to make it build on the fly?

 BEGIN TRANSACTION;
 CREATE TABLE android_metadata (locale TEXT);
 INSERT INTO android_metadata VALUES('en_US');
 CREATE TABLE 'olddominionuniversity' (_id integer primary key
 autoincrement, university text not null, building text not null,
 locode text not null);
 INSERT INTO olddominionuniversity VALUES(1,'Old Dominion
 University','Kaufman Hall','IDEA-7TCL');
 INSERT INTO olddominionuniversity VALUES(2,'Old Dominion
 University','Perry Library','RE3S-XR5T');
 DELETE FROM sqlite_sequence;
 INSERT INTO sqlite_sequence VALUES('olddominionuniversity',2);
 CREATE TABLE harvarduniversity (
     _id INTEGER,
     university TEXT,
     building TEXT,
     locode TEXT
 );
 INSERT INTO harvarduniversity VALUES('_id','Harvard','Building
 1','TBA');
 COMMIT;

 I tried to put it as a string and execute it but I get all sorts of
 error. When I did line by line, it worked, but I am talking bout a
 HUGE database

 On Jun 21, 1:47 pm, Georgy georgearna...@gmail.com wrote:

  my only way to do it was to dump the database and get the code and
  insert it in the database to build it on the fly just like Burton
  Miller suggested.

  I think this is not the best approach and could slow things down
  tremendously

  On Jun 20, 4:51 pm, burton miller burton.mil...@gmail.com wrote:

   this was not possible in previous versions of the os - maybe it is
   now.

   up until now, you have three options:
   1) build db on the fly
   2) put db in assets, then copy it to db directory when you first run
   (2x space).
   3) install db from internet as a secondary installation

   if things have changed - then i'll rewrite one of my apps!

   On Jun 19, 12:43 pm, Georgy georgearna...@gmail.com wrote:

Hello

I have an SQL lite database that I am trying to copy to the device. I
was able to copy it to the emulator easily using DDMS however with the
protection in the device, I cannot access the database files from the
DDMS perspective.

I read many attempts here but couldn't find an easy solution.

Is there any way to attach the database (let's say named 'proj') and
replace the currently created database proj in he device files?

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: Where are files created in the simulator stored?

2009-06-23 Thread Odessa Silverberg

Picturefiles are never ascii.

However, to anwser the first part as where the files are saved: In
Windows VIsta they are stored in

C:\Users\YourWindowsUsername\AppData\Local\Android\SDK-1.1
or
C:\Users\YourWindowsUsername\AppData\Local\Android\SDK-1.0

but there are only image files inside, which you can't directly edit.
However it's usefull if you want to make a backup of it or so
On Jun 23, 3:47 am, junker37 junke...@gmail.com wrote:
 Thanks.  I was able to get the file using adb pull and by looking at
 it, I realized I was assuming the file was ascii and was able to fix
 the problem.

 On Jun 22, 7:48 pm, Geoff Stromberg geoff.stromb...@gmail.com wrote:



  As Dianne said, use adb shell to get a shell prompt on the emulator. Then:

  cd /data/data/com.your.package/files

  If I'm remembering things correctly, that directory should contain files
  created from within your app.

  As for opening the userdata.img, I think that's a flash memory device image,
  and isn't easily accessible. I remember seeing some steps for mounting it on
  linux, but I don't recall where.

  On Mon, Jun 22, 2009 at 5:40 PM, Dianne Hackborn hack...@android.comwrote:

   You can use adb pull and adb push to retrieve and send, respectively,
   files with the emulator.

   You can use adb shell to get a command line shell in the Android system,
   allowing you to browse through the filesystem.

   On Mon, Jun 22, 2009 at 5:36 PM, junker37 junke...@gmail.com wrote:

   Yeah, the file exists and I can read it in my code.  However, I want
   to verify it on my filesystem.  The path is /data/data/example.app/
   files/4de67f137f7fa92bab63569f565c888 which obviously doesn't exist on
   Windows.  So, I'm assuming that the path is relative to the emulator
   data root.

   I believe I found where the emulator data is stored.  There's a file
   userdata.img, however, I tried opening it with winimage, thinking it
   was an img file, it was not.

   Does anyone know how to access the contents of userdata.img?

   On Jun 22, 5:37 pm, Marco Nelissen marc...@android.com wrote:
On Mon, Jun 22, 2009 at 2:32 PM, junker37 junke...@gmail.com wrote:

 I'm wondering where files that are created while running in a
 simulator are stored.
 I'm running the 1.5 simulator on Windows Vista.

Nitpick: you're running the emulator, not the simulator.

The real reason I want to find the files is because I am downloading

 an png file and trying to create a bitmap via: Bitmap bitmap =
 BitmapFactory.decodeFile(iconFile.getAbsolutePath());
 However, the bitmap is always null.
 I am able to create a bitmap successfully if I have the file as a
 resource.

Can you access the file otherwise? I.e. can you open and read the file
   that
exists at iconFile.getAbsolutePath() ?

   --
   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: Access to cookies managed by Browser app

2009-06-23 Thread Mark Murphy

 Is it possible to access cookies managed by the Browser app (i.e. not
 a custom WebView)?

Not that I am aware of.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: PMD Android ruleset

2009-06-23 Thread Fred Grott(shareme)

Thanks, yes will be doing that as well :)



On Jun 23, 10:14 am, www.rzr.online.fr www.rzr.online...@gmail.com
wrote:
 On Jun 2, 8:50 pm, Fred Grott(shareme) fred.gr...@gmail.com wrote:

  I am extending the PMD ruleset used in AndCooper to cover more:
 [...]
  Any more issues you see that should be a PMD rule?

 Do you manage to generate reports ?
 Feel free to submit your rule on pmd tracker 
 :https://sourceforge.net/tracker/?group_id=56262atid=479923

 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: Information about nearby businesses

2009-06-23 Thread Fred Grott(shareme)

If I remember correctly Google MAps API does not supply geocoding so
you would need to integrate with one o f the free ones out there and
that should enable you to match up to business data..

Search this forum as there are some posts about it..listing the free
API/services and etc


Fred Grott
http://mobilebytes.wordpress.com


On Jun 21, 3:09 pm, Chris chrismc...@hotmail.com wrote:
 Hi,

 I am looking for ways to get information on nearby businesses like
 restaurants etc., given a GPS long/lat item.

 1. Reverse Geocoding does not seem to give me this information.

 2. Google Maps/Earth has a Businesses overlay, is this data somehow
 accessible?

 3. Can I perform a Google Search Engine search? The AJAX Search API
 does not seem to be available on Android.

 4. When I do a normal Google Search on a City and e.g. Starbucks, I
 get much more hits than in 2., that's why I could prefer 3.

 Any Ideads are appreciated!
 Thanks,
 Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] help on video recording

2009-06-23 Thread cindy

I have tried a long time to recording video using 1.5's new API. I
really could not make it work. Have you try it? Do you know any sample
demo code for video recording ?

Thanks!

Cindy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application Needed

2009-06-23 Thread Fred Grott(shareme)

I would imagine if you would mention your branch of service that might
help in getting the help you require.

Myself, I am a former Airman, USAF..1980s..

Fred Grott
http://mobilebytes.wordpress.com



On Jun 22, 3:49 am, bizzy401 bizzy...@gmail.com wrote:
 I am an instructor in the military.  I have an instructor evaluation
 coming up and I am looking for an application that might be able to
 help me out.  When I am instructing a class I have to ask a question
 every three to six minutes.  No more no less.  I was looking for an
 app that would vibrate in my pocket every four minutes.  Does anyone
 know of an app like this?

 Thank you very much for any help that is offered.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Get a unique string / serial number?

2009-06-23 Thread dapaintballer331

Is there any way to get some type of serial number or unique string,
that no other android device should have?

It can't be relative to the sim card, I'm looking for some type of
hardware identification number...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Does anyone make video recording work at Android 1.5?

2009-06-23 Thread cindy

please help me!

On Jun 22, 9:45 am, cindy ypu01...@yahoo.com wrote:
 I have tried 1.5 video API. I could not make it work.It even can't do
 preview.

  following is my code:
 private boolean initializeVideo() {
         Log.v(TAG, initializeVideo);

         if(Common.mRecordedVideo!=null  Common.mRecordedVideo.exists())
                 Common.mRecordedVideo.delete();
         File sDir = Environment.getExternalStorageDirectory();
         String baseDir = sDir + Common.BASE_DIR;
         File sampleDir=new File(baseDir);
         if(!sampleDir.canWrite()) // Workaround for broken sdcard
 support on the device.
             sampleDir = new File(/sdcard/sdcard);

         try
         {
             Common.mRecordedVideo = File.createTempFile(PREFIX,
 EXTENSION, sampleDir);
         }
         catch(IOException e)
         {
             AlertDialog.Builder ab = new AlertDialog.Builder
 (VideoRecord.this);
             ab.setTitle(Error);
             ab.setMessage( can't write audio data to storage);
             ab.setIcon(R.drawable.error);
             ab.setNeutralButton(Close, new
 DialogInterface.OnClickListener()
             {
                 public void onClick(DialogInterface dialog, int
 whichButton)
                 {
                 }
             });
             ab.show();
             return false;
         }

         Intent intent = getIntent();
         releaseMediaRecorder();

         if (mSurfaceHolder == null) {
             Log.v(TAG, SurfaceHolder is null);
             return false;
         }

         mMediaRecorder = new MediaRecorder();

          mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

         mMediaRecorder.setVideoSource
 (MediaRecorder.VideoSource.CAMERA);
         mMediaRecorder.setOutputFormat
 (MediaRecorder.OutputFormat.THREE_GPP);

         mMediaRecorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
         mMediaRecorder.setOutputFile
 (Common.mRecordedVideo.getAbsolutePath());

         // Use the same frame rate for both, since internally
         // if the frame rate is too large, it can cause camera to
 become
         // unstable. We need to fix the MediaRecorder to disable the
 support
         // of setting frame rate for now.
         mMediaRecorder.setVideoFrameRate(20);
        mMediaRecorder.setVideoSize(352,288);

         mMediaRecorder.setVideoEncoder
 (MediaRecorder.VideoEncoder.H263);

         mMediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());

         try {
             mMediaRecorder.prepare();
         } catch (IOException exception) {
             Log.e(TAG, prepare failed for  );
             releaseMediaRecorder();
             // TODO: add more exception handling logic here
             return false;
         }
         mMediaRecorderRecording = false;

         return true;
     }

  private void startVideoRecording() {
         Log.v(TAG, startVideoRecording);
         if (!mMediaRecorderRecording)
         {
                 // Check mMediaRecorder to see whether it is initialized or
 not.
             if (mMediaRecorder == null  initializeVideo() ==
 false )
             {
                 Log.e(TAG, Initialize video (MediaRecorder)
 failed.);
                 return;
             }
             try
             {
                 mMediaRecorder.setOnErrorListener(this);
                 mMediaRecorder.setOnInfoListener(this);
                 mMediaRecorder.start();   // Recording is now started
             } catch (RuntimeException e) {
                 Log.e(TAG, Could not start media recorder. , e);
                 return;
             }
             mMediaRecorderRecording = true;
             mRecordingStartTime = SystemClock.uptimeMillis();
             updateRecordingIndicator(true);
             mRecordingTimeView.setText();
             mRecordingTimeView.setVisibility(View.VISIBLE);
             mHandler.sendEmptyMessage(UPDATE_RECORD_TIME);
             setScreenTimeoutInfinite();
         }
     }

 On Jun 21, 6:05 pm, cindy ypu01...@yahoo.com wrote:

  do you have any simple sample code for video recording?

  Thanks!

  Cindy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Possible bug when extending themes

2009-06-23 Thread Moxor

Hi,
 I have the same problem, did you find the way to fix it?

Thank you.

On 25 mayo, 18:20, TjerkW tje...@gmail.com wrote:
 I was typing and accidently pressed send

 So here again the problem.

 I have a styles.xml with the following content:

 resources
         style name=SpaceWarsTheme
 parent=android:Theme.NoTitleBar.Fullscreen
                 item name=android:windowNoTitletrue/item
                 item name=android:textColorPrimary#FF00/item
                 item 
 name=android:windowBackground@drawable/spacebackground/
 item
   /style
 /resources

 However i get the following message in eclipse

 The word ''@drawable is not correctly spelled

 But that is nonsense!
 I check the styles.xml that comes with android and found the following

                 item name=windowBackground@android:drawable/
 screen_background_dark/item

 However even this gives me the error message?!!@

 What am i doing wrong?

 On 25 mei, 23:17, TjerkW tje...@gmail.com wrote:

  I am extending a theme by creating a style.xml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Build apk from command line

2009-06-23 Thread sumd

Hi,

 Is is possible to build apk with jar, Manifest.xml, and res
directory?

 I've a jar file with one activity. Application which will use this
jar can come from external.
I'm not giving my jar file to the app developer. I would like to build
an apk which includes my jar, application jar, application manifest
and resources.
According to this thread
http://groups.google.com/group/android-developers/browse_thread/thread/11aa21996839cef5/9d3d978fdfcd48e9?hide_quotes=no,
we can't include resources and manifest in a jar.
 My goal is to edit the manifest to list my activity (the one inside
jar) and make it as a launcher activity, and build apk with
application jar, resources and my jar. I understand ant needs other
things like build.xml and project properties.

Is there any other way to build apk from command line with jar,
manifest, biuld.xml and resources?

Thanks,
sumd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Spinner to play sound.

2009-06-23 Thread KoZinE

Hi,

I am currently doing an application which will play a sound from a
selection via a spinner. I've tried many ways but I still cannot get
it to play a sound.

Here is my code for the constraints and spinner.

// List-based Constants
public static final int HAPPY = 0;
public static final int LAUGHTER = 1;

//code for spinner
Spinner s = (Spinner) findViewById(R.id.SoundSpinner);
ArrayAdapter adapter = ArrayAdapter.createFromResource
(
   this, R.array.Sounds,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
s.setAdapter(adapter);
s.setOnItemSelectedListener(OnItemSelectedListener);

Spinner.OnItemSelectedListener OnItemSelectedListerner
= new
OnItemSelectedListener() {
public void onItemSelected(AdapterView parent,
View v, int idNum,
long id) {


switch (idNum){
case HAPPY:
  Music.play(this, R.raw.happy);
break;
case LAUGHTER:
Music.play(this, 
R.raw.laughter);
break;

 }
 }
 public void onNothingSelected(AdapterView
arg0) {}
 };

I know android's spinner does not respond to setOnItemClickListener.
However, when I changed it to onClick, I get confused with the code
and the application quits by itself when I run it on the emulator. Can
anyone help me? Thank you so much! (:

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: One activity per view

2009-06-23 Thread 张飞
Maybe u can write youe AndroidManifest.xml  like this:

activity android:name=.activityOne
   android:label=@string/app_name
   intent-filter
   action
android:name=android.intent.action.MAIN /
   category
android:name=android.intent.category.LAUNCHER /
   /intent-filter
/activity
   activity android:name=.activityTwo android:label=@string/
app_name
   /activity
   activity android:name=.activityThree
android:label=@string/
app_name
   /activity

2009/6/22 bsbi...@googlemail.com bsbi...@googlemail.com


 Hi,

 Thanks.

 I have currently have three pages and have three activities. The
 problem is that when I deploy the app on my phone I see three app
 icons

 Any ideas?

 How do I say activityOne is the default activity and the other two are
 sub-activities of activityOne?

 activity android:name=.activityOne
android:label=@string/app_name
intent-filter
action
 android:name=android.intent.action.MAIN /
category
 android:name=android.intent.category.LAUNCHER /
/intent-filter

activity android:name=.activityTwo
 android:label=@string/
 app_name
/activity
activity android:name=.activityThree
 android:label=@string/
 app_name
/activity









 On Jun 22, 12:49 pm, Mark Murphy mmur...@commonsware.com wrote:
   bsbi...@googlemail.com wrote:
   I am developing an app with there pages (views). Would each page be a
   separate activity?
 
  Possibly. You can go either way. I usually assume separate activities
  until something forces my hand to go to multiple pages in one activity.
 
  --
  Mark Murphy (a Commons Guy)http://commonsware.com|
 http://twitter.com/commonsguy
 
  Looking for Android opportunties?http://wiki.andmob.org/hado
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 actual Table with borders in display layout ?

2009-06-23 Thread Mapara,Harshit Nitinkumar

Hi guys,

I'm new in Android. I searched a lot to get a table with borders, but
I am not getting result.

I want a table with two colums, borders, white backgroud in table.
first colums should be right aligned and second column should be left
aligned.

With TableLayout, rest of things can be done, but not I can get table
with border in display.

Please help
Thanks

Harshit

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] onRecieve starting activity problem

2009-06-23 Thread ani

Guys,

I would like to know the reason behind this behaviour.I have a
broadcast reciever and in onrecieve i am trying to start an
activity,however if i am not giving the flags it is giving an
exception .On declaring the flags it is working perfectly fine,why?

I was under the impression that onRecieve runs in the main UI thread
and we can launch an activity in onRecieve.Error given by the emulator
is self explanatory but still why do i need to create an activity in a
new task(only in onRecieve)?

onRecieve {
Intent intent4activity2 = new Intent
(android.intent.action.activity2);
//intent4activity2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
arg0.startActivity(intent4activity2);
}

regards,
ani

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 call Camera application from my own application

2009-06-23 Thread N0m0r3l13s

Hi.

I suppose there must be an Intent to call the camera app.

Other thing is if you want to capture video directly from camera.
The best way you can do it is analyzing the camera application that
comes from
google. And follow up the steps to set it up in you program.

Sorry, cannot help more.


On 23 jun, 07:38, cindy ypu01...@yahoo.com wrote:
 I want to call camera application from my own application, take video.
 Then I want to get the video back and return to my application. How
 Can I do it?

 Thanks!

 April

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] FLAG_ACTIVITY_NEW_TASK why is it required in onRecieve when starting activity

2009-06-23 Thread ani

Guys,

I was under the impression that onRecieve runs in the main UI thread
and we can launch an activity in onRecieve without setting the flag as
new task.Why do we need to create a new task and launch the activity
there.Why cant the activtiy launch in the task in which main UI thread
is running?

regards,
ani

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Google map does not work.

2009-06-23 Thread Jack

Hello all,

I'm new to android and need some help. I'm creating a basic Mapview
application which will display my current location on the google map.
Initially i had many doubts while creating the application, but thanks
to google archives that helped me to reach this point. I
have followed almost all the threads on the google site
but still unable to see my location on the google maps. It always
shows a white screen on the emulator with google image at the bottom.
Please help to make it work. From most of the threads I learn that we
need to sign our application with the correct fingerprint. I did so
but unsuccessful.

The following will explain the steps:
1. Using sdk version android-sdk-windows-1.0_r1
2. Created a new android application.
3. Signing the application:
a. C:\Program Files\Java\jdk1.6.0_13\binkeytool.exe -list -alias
androiddebugkey -
keystore D:\Profiles\fknq86\Local Settings\Application Data
\Android\debug.keyst
ore -storepass android -keypass android
b. Certificate fingerprint (MD5):
75:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:33
where XX=some alpha numeric data
c. signing up for an Android Maps API key! using link
Sign Up for the Android Maps API - Android Maps API - Google Code
4. Code below: There are 2 applications 1. Find Me 2. ShowMyLoc.
FindMe has a button which directs it to ShowMyLoc (using Intent) to
show the location on the google maps. For simplicity sake i'm pasting
the code only for ShowMyLoc app.

//ShowMyLoc.java
Code:

package org.anddev.android.findme;

import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class ShowMyLoc extends MapActivity {
   private Location myLocation;
   protected MapView myMapView = null;
   protected LocationManager myLocationManager = null;
   protected MapController mapController;

   @Override
   protected boolean isRouteDisplayed() {
   // TODO Auto-generated method stub
   return false;
   }

   @Override
   protected void onCreate(Bundle icicle) {
   // TODO Auto-generated method stub
   super.onCreate(icicle);
   this.myMapView = new MapView(this,
0ZFOV5MY-5tIiNoVa_UiMuiMf39w_N6T5DalZzg);

   this.setContentView(myMapView);

   mapController = myMapView.getController();
   mapController.setZoom(15);

   this.myLocation = new Location(gps);
   this.myLocation.setLongitude(77.52436144125092);
   this.myLocation.setLatitude(13.05096452223662);
   updateView();
   }

   private void updateView(){
   Double lat = myLocation.getLatitude();
   Double lng = myLocation.getLongitude();

   GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
   mapController.setCenter(point);
 }

//Menifest.xml

HTML Code:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
 package=org.anddev.android.findme
 android:versionCode=1
 android:versionName=1.0.0
 uses-permission
android:name=android.permission.READ_CONTACTS /
 uses-permission
android:name=android.permission.CALL_PHONE /
 uses-permission
android:name=android.permission.ACCESS_FINE_LOCATION /
 uses-permission android:name=android.permission.ACCESS_GPS /

 uses-permission
android:name=android.permission.ACCESS_MOCK_LOCATION /
 uses-permission
android:name=android.permission.ACCESS_COARSE_LOCATION /
 uses-permission android:name=android.permission.INTERNET /
 uses-permission
android:name=android.permission.ACCESS_LOCATION /
 uses-permission
android:name=android.permission.ACCESS_ASSISTED_GPS /
 uses-permission
android:name=android.permission.ACCESS_CELL_ID /

   application android:icon=@drawable/icon
android:label=@string/
app_name
   uses-library android:name=com.google.android.maps /
   activity android:name=.FindMe android:label=@string/
app_name
   intent-filter
   action android:name=android.intent.action.MAIN /

06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/
class/switch/test2' (m)

06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)

06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/
class/switch/test' (m)

06-23 16:49:43.388: ERROR/flash_image(544): can't find recovery
partition

06-23 16:50:01.388: ERROR/MemoryHeapBase(572): error opening /dev/
pmem: No such file or directory

06-23 16:50:01.398: ERROR/SurfaceFlinger(572): Couldn't open /sys/
power/wait_for_fb_sleep or 

[android-developers] Retrieving the default email from the email client provided by Android

2009-06-23 Thread Eddie Ayling

Hi Everyone,
I am developing an application which requires to autopopulate a
default email field.
The logical choice is to retrieve the email address from the email
client provided by android.
I searched the content providers and did not find anything about the
email client.
How is this information stored?
How can I reach it?

Cheers,
Eddie

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Porting RDP (Remote Desktop Protocol) to Android -- questions

2009-06-23 Thread kirkbeaty

Attempting to port RDP to Android ... saw someone had started this,
Desktoid/Connectoid, but that effort seems to have stopped .. and I
need this function immediately.   I have initial screen image of the
Desktop displayed (with some local Android GUI expert's help) on the
Android as a Bitmap.

There are several calls that RDP does which I can not find equivalents
in the Android GUI.   Those in the subject and others:

drawGlyph, setClip, Cursor,  IndexColorModel, etc.

Just to get the initial image was not without considerable effort ...
little things like which Bitmap.Config was used was key ... seems it
requires Bitmap.Config.RGB_565  (others did not work, and without
understanding as to why ?).

Willing to partner with any experts out there to get this completed.
Think it a very useful utility.

Of course, we need to have real ENTERPRISE WPA (even iPhone has this
out of the box) to really make this complete (instead of doing it on
emulator only :-)

Thanks for any assistance anyone can provide.
Kirk Beaty
kirkbe...@gmail.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] How to hang an outgoing call? (Revisited, Partly solved here)

2009-06-23 Thread N0m0r3l13s

Hi all,

I'm just doing an application that controls who to call and how many
rings let the call do. For example, to not wake up someone in the
morning we only do 3 tones...

I'm using the standard BroadcastReceiver method to stop the call from
going out.

I explain here for the people who want to do it, also.

[ Manifiest ]
1.- You need enough permissions:
uses-permission
android:name=android.permission.PROCESS_OUTGOING_CALLS /
uses-permission android:name=android.permission.CALL_PHONE /

To make calls and process outgoing calls.

2.- You need a broadcast receiver that catches the broadcast intent:

receiver android:name=.receiver.PhoneOutgoingCallReceiver
android:enabled=true 
intent-filter android:priority=0
action 
android:name=android.intent.action.NEW_OUTGOING_CALL /
/intent-filter
/receiver

[ Code ]

3.- You controls who can call in the:

@Override
public void onReceive(Context context, Intent intent) {

}

4.- If you don't want to let any call go out you can:

@Override
public void onReceive(Context context, Intent intent) {
setResultData(null);
}

5.- Use the to get the call information.

Bundle extras = intent.getExtras();

for(IteratorString 
it=extras.keySet().iterator(); it.hasNext();)
{
String key = it.next();
Log.d(LOG_TAG, key);
Log.d(LOG_TAG, Value:  + 
extras.getString(key));
}

BUT!

With this I can only censure calls, can't control how many time the
ring sounds.

the question is:


How can I delay a little bit the call cancellation?

I want to make it sound, for example, 3 seconds and then hang up.

Thank you all!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Transparency/Translucency working on emulator but not device

2009-06-23 Thread Carl Minden

I have tried to replicate the Transparency/Translucency effects
created in the API Demo(which works flawlessly) and the code i wrote
works on the emulator but not on my actual device(Google ION)

I copied the styles and colors.xml files from the API demos code and
set the theme of my activity I want to be transparent to @style/
Theme.Transparent in my activity i set my content view to a layout
which contains only a TextView containing :
TextView xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/text
android:layout_width=fill_parent
android:layout_height=fill_parent
android:gravity=center_vertical|center_horizontal
android:text=should have transparent background
/
 i have also tried setting the theme using: setTheme
(R.style.Theme_Transparent);

but nothing I try seems to work on the device, Any thoughts? is there
something I am missing?

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: No one ever answer my posts !!!!

2009-06-23 Thread Brian Cloutier
And posts like that aren't going to help your case.

On Mon, Jun 22, 2009 at 8:36 PM, Rotem Or rote...@gmail.com wrote:


 --
 Thanks
 Rotem Or

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] MemoryFile between processes

2009-06-23 Thread Alec

Hi,

I've been able to send data via shared memory between threads within a
process using MemoryFile.  I then tried to send data between a service
and an activity in different processes, but the data did not get
passed.  The name for each call the MemoryFile's constructor was the
same.  Is it possible to share data between processes using a
MemoryFile?

Thanks,
Alec

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 close activity?

2009-06-23 Thread Fei Zhang
I don't think you need close 2, the system will do it! Is it right?

2009/6/23 tstanly tsai.sta...@gmail.com


 hi all,

 i have a app,the structure composed three .java,
 1.java,2.java,3.java

 their relationship is:
 1-2-3
 and 3 can go back to 1

 when i was back to 1 from 3,
 i want to close the 2,

 how to do this?
 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] How to add a new text language in my Android when not included?

2009-06-23 Thread camilo.arreaza

How can i add a new text languaje not included as an option when
writing a memo or text mesage in Android?

Imagine you work for a multinational In Switzerland where you might
speak in German and English, you live in a French speaking city and
you are part of the huge comunity from Latin América (nearly 25% of
Geneva's Market place speaks espanish)...you might write e-mails to
your family and olde friends once in a while..but with Android you
can't because that text language is not an option!!..

Using Android i'm surprise to find  that i can ONLY switch between
German, Italian, French, English and Portugues...

When deciding in between the Apple aplication for the Iphone and
Android i'm glad to see that apple let you switch between any single
text language..from Chinese to greek, japanese or Espanish etc..
without restriction..

What if you are part of those 10 thousend Chinese working at ONU
here?, or if your mother language is Sweedish?




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: listview click problem

2009-06-23 Thread neoLwin

Try setting the width of the list view to fill_parent.

On Jun 21, 10:13 pm, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 i have a listview as bellow,

 ---
 Google
 ---
 Yahoo!
 --

 if i want to go to the Google,
 just click the Google of the list,
 but it just active when i click on the word Google
 because i wish can click anywhere if it's click on the same raw of
 Google word

 but now i must click on the word(Google or Yahoo!),
 how can solve??

 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] help me

2009-06-23 Thread Dorjoo B

how to detect key event in android service ? please help

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



[android-developers] IPsec support ?

2009-06-23 Thread Ram

Hi,

Is there IPsec support on Android.
Does Android support Application developers to make use of the IPsec ?

Thank you,
Ram.

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



[android-developers] Re: Progress Dialog When Application Starts

2009-06-23 Thread Brian Cloutier
It's been a while since I last made an Android Application, so take this
with a grain of salt, but can't you just fire an intent to start the dialog
from onStart()?

On Mon, Jun 22, 2009 at 9:06 PM, Georgy georgearna...@gmail.com wrote:


 Hello,


 I am trying to initiate a progress bar when my application starts. The
 way my application works is that it collects info from the db that
 takes around 5 to 6 secs where the screen is completely black.  I am
 trying to initiate a progress dialog that gets triggered WITHOUT a
 button click or any other UI interaction but just when the user starts
 the application.

 All the previous posts handled something with handlers and UI
 interactions.

 any luck?

 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: Resizing an image

2009-06-23 Thread p1erstef

I met the same issue.
Here the workaround I found :

BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap bitmap = BitmapFactory.decodeFile(filename, options);
BitmapDrawable drawable = new BitmapDrawable(bitmap);
imageView.setImageDrawable(drawable);

Hope this helps,

Pierre


On Jun 1, 3:36 pm, Android Users androidmai...@gmail.com wrote:
 Hi all,
 Can i resize an image to a lower resolution as i am getting an
 OutOfMemoryException when trying to display image with 2048x1536 resolution
 or more?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Calibration with the environment may improve the readings ?!

2009-06-23 Thread Gryyphyn

I haven't looked through the source for the compass but there has to
be a set() method that you can apply a positive or negative value to,
possibly on tha app level. The compass is accurate enough so all you
would really have to do is assign a set() method to a menu calibration
option to allow the user to align with a standard compass and set the
value that modifies the OSD compass alignment, similar to the bubble
app and its calibration with the accelerometers. Just a thought...

Gryyphyn, out.

On Jun 16, 10:21 pm, Delta Foxtrot deltafoxtrot...@gmail.com wrote:
 2009/6/17 flegare fleg...@gmail.com



  I auto answer myself and the poor soul who fall on this post, so far
  the only way to calibrate is by making big 8-like gesture with the
  phone. Try it it worked for me.

 Yes, the digital compass in the G1 is self calibrating, but you have to make
 figure 8's or similar to make it do it, this isn't something you can do in
 software, the Android OS has magnetic field projections for the earth and if
 the current reading falls outside a specific range either something is
 artificially influencing it, such as the magnetic field in metals or
 electromagnetic fields caused by electronics and cars etc, or it needs
 calibration.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] weird drawing on canvas bitmap

2009-06-23 Thread sleith

hi, i'm trying to draw bitmap in canvas.
the bitmap is used to draw text and background using canvas (named
canvasBitmap)
but the text or background that are drown to bitmap is not displayed,
as if it's out of bounds.
i have to translate the canvasBitmap at some points to make it draw at
right position.
The problem is i don't know how many pixel i should translate to.

here's the code example:

public OnDraw(Canvas c){

  Paint mBackgroundPaint = new Paint();
  mBackgroundPaint.setColor(Color.RED);

  String mText = Testing;

  Paint mFontPaint = new Paint();
  mFontPaint.setColor(Color.WHITE);

  //setting rect
  Rect mBackgroundRect = new Rect();
  mFontPaint.getTextBounds(mText, 0, mText.length(), mBackgroundRect);

  //the bitmap to be drawn a text and backgroundRect
  Bitmap mBitmap = Bitmap.createBitmap(mBackgroundRect.width(),
mBackgroundRect.height(), 
Bitmap.Config.ARGB_);
  Canvas mCanvasBitmap = new Canvas(mBitmap);

  //draw text and background to bitmap
  mCanvasBitmap.drawColor(Color.CYAN);
  mCanvasBitmap.drawRect(mBackgroundRect, mBackgroundPaint);
  mCanvasBitmap.drawText(mText, 0, 0, mFontPaint);

  //draw bitmap to canvas
  c.drawBitmap(mBitmap, 0, 0, null);
}

this will only drawn Cyan color, the text and red background is not
displayed
i have to translate for example :
mCanvasBitmap.translate(0, mBackgroundRect.height())

to make it displayed (but not 100% correctly position)
please help .
thx

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



[android-developers] Problem with createBitmap method

2009-06-23 Thread hamlatzis

My application crashes after I try to use the static Bitmap
createBitmap method to get a mutable bitmap in order to fill it later
with data.

If I only create one 1024x1024 the application works just fine, but
when I try to load the same image more than once (first making my
object null in each round) my application crashes on my third or
fourth try.

eg
Bitmap mpBitmap = null;

void CreateBitmap(int nWidth, int nHeight)
{
 if ( mpBitmap != null )
  mpBitmap = null;
 mpBitmap = Bitmap.createBitmap(nWidth, nHeight,
Bitmap.Config.ARGB_);
}


I get the same result if I create a smaller image but then I need more
runs before the crash. In all cases my application works just fine if
I only create the image (even 1024x1024) once, then exit my
application and run it again.

If there is a need for crash dump I can provide one.

Any help will be appreciated.

Thanks,

Iosif

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] SensorListener and MediaPlayer (Audio)

2009-06-23 Thread Donn Felker

I'm developing an application that responds to certain accelerometer
events such as movements to the left or right when a certain delta is
reached. When these deltas are fired I want to play a sound with the
MediaPlayer.

I'm using the Sensor Simulator by Open Intents to simulate sensor
events. I have the code set up, and I also have some basic
android.util.Log.e(...) statements telling me when these events are
fired. When I simulate the sensor, my deltas are met and my log
statements are output to LogCat. Therefore I know this is working.

However, I now want to play an audio resource file (mp3).

I added a method inside of the SensorListener definition called
PlayMedia(). This simply does the following:


private void PlayMedia()
{
if(mp != null)
{
android.util.Log.e(test,mp is not null, 
cleaning up!);
if(mp.isPlaying())
{
android.util.Log.e(test,Stopping the 
mp!);
mp.stop();
}
}
// is not playing.
android.util.Log.e(test,creating a new mp);
mp = MediaPlayer.create(getApplicationContext
(),com.MyCompany.Apps.MyApp.R.raw.mySound);

android.util.Log.e(test,Start the sound);
mp.start();
mp.reset();
}

However, when I calll this, no sound ever happens. The log messages
are output into LogCat. Therefore the code is making it into the
method, yet no sound is being output.

The odd thing is, I opened the ApiDemos and rand the Media demos and
they worked perfectly. The resource apidemo worked and played the
sound in the emulator. However, in my testing, I cannot get it to
play.

I've done the following: Moved the player code outside of the
sensorlistener into the activity and then called the PlayMedia() from
within the nested SensorListner, and it still doesnt work.

The only thing different in this code than in the ApiDemo is that my
MediaPlayer is inside of the SensorListener (as shown below). I also
use getApplicationContext() because in the ApiDemo's the example shows
this as it is inside of an Activity.

Why would the sound _not_ play? Its a 56kbps file. I've also taken the
same resource from the APiDemo's and tried to use that and still, no
dice.

I'm also noticing that I'm having to fully qualify my resources (R)
which is kind of odd. Anyone know why that would happen? Would that be
the cause? I've deleted, the gen folder and regnerated it a few times
and I still have to fully qualify my Resources. (I'm using Eclipse).

Does anyone know why this would not work?


Thanks,

Donn

--- Code below --

private final SensorListener mListener = new SensorListener() {

private MediaPlayer mp;

private final float[] mScale = new float[] { 2, 2.5f, 0.5f }; //
accel

private float[] mPrev = new float[3];

public void onSensorChanged(int sensor, float[] values) {
boolean show = false;
float[] diff = new float[3];

for (int i = 0; i  3; i++) {
diff[i] = Math
.round(mScale[i] * (values[i] - 
mPrev[i]) * 0.45f);
if (Math.abs(diff[i])  0) {
show = true;
}
mPrev[i] = values[i];
}

if (show) {
// only shows if we think the delta is big enough, in 
an attempt
// to detect serious moves left/right or up/down
android.util.Log.e(test, sensorChanged  + sensor + 
 (
+ values[0] + ,  + values[1] + ,  + 
values[2] + )
+  diff( + diff[0] +   + diff[1] + 
  + diff[2]
+ ));
}

long now = android.os.SystemClock.uptimeMillis();
if (now - mLastGestureTime  1000) {
mLastGestureTime = 0;

float x = diff[0];
float y = diff[1];
boolean gestX = Math.abs(x)  3;
boolean gestY = Math.abs(y)  3;




if ((gestX || gestY)  !(gestX  gestY)) {


if (gestX) {
if (x  0) {
PlayMedia();
android.util.Log.e(test,
 LEFT 
);

} else {

[android-developers] handling events (click, tap, touch) for map (mapview, mapactivity)

2009-06-23 Thread maijau

Hello,

could anyone point me to some documentation or code on what's the
official way to handle events on a mapview or within a mapactivity? I
have searched around, there seem to be lots of questions regarding
this issue, few answers, and every answer is different.
As an example, I want to do something similar to the MyTracks
application: on a touch on the map, the builtin zoomcontrols appear,
panning still works, and in addition, other controls (the next/prev)
buttons are shown.

It seems I cannot achieve the desired effect using standard event
handlers, e.g. I could not get it to work by setting an
onClickListener or onTouchListener and implementing onClick()/onTouch
().

What is not clear to me:
- do I have to go directly to using overlays to achieve such an
effect? I understood overlays are more intended to display data on
maps, as opposed to controls?
- do I have to subclass mapview or mapactivity or both?
- is there a way without extending mapview, mapactivity and just
employing the standard event handling interface?

Thanks
Martin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Integrate your own application into the Maps application

2009-06-23 Thread patschius

Hello,

My question is: Is it possible to alter the standard Maps application
on Android in such a way that it is able to show for example some
specific POIs on the map

Google Latidude enhances Google Maps for its purposes in this way.

So is it possible for a developer outside of Google to enhance the Map
application too?

I have searched for the source of the Map application but did not
found anything. Is this part not Open Source?

thx for your answers
CP

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Skype Lite Intent Mangement

2009-06-23 Thread Rick

Does anyone know if it is possible to open up skype lite chat using
intents or some other API?

Suppose I wanted to create a short cut for a contact and I had their
skypename or skype id or skype email.

Would it be possible to do something like:
Intent i = new Intent(
 Intent.ACTION_VIEW,
 Uri.parse(skype:ladiesman217?chat)
);
i.setComponent(
new ComponentName(
 com.skype.android.lite,
 com.skype.android.lite.SkypeActivity)
);
startActivity(i);

I've pinged the Skype developer community about this with no results,
has anyone had any lucky with this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Application Needed

2009-06-23 Thread Brian Cloutier
While I do not know of such an app, if you give me a week or two I could
write one for you.

On Tue, Jun 23, 2009 at 9:56 AM, Fred Grott(shareme)
fred.gr...@gmail.comwrote:


 I would imagine if you would mention your branch of service that might
 help in getting the help you require.

 Myself, I am a former Airman, USAF..1980s..

 Fred Grott
 http://mobilebytes.wordpress.com



 On Jun 22, 3:49 am, bizzy401 bizzy...@gmail.com wrote:
  I am an instructor in the military.  I have an instructor evaluation
  coming up and I am looking for an application that might be able to
  help me out.  When I am instructing a class I have to ask a question
  every three to six minutes.  No more no less.  I was looking for an
  app that would vibrate in my pocket every four minutes.  Does anyone
  know of an app like this?
 
  Thank you very much for any help that is offered.
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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   >