[android-developers] How to load a bitmap to a server directly?

2008-03-26 Thread Ken

Hi there,

I've followed this link and I know how to upload a file to a server:
http://www.anddev.org/upload_files_to_web_server-t443-s30.html

However, let's say I've a Bitmap that I've received from the web, and
I want to upload it to a server. Is there any ways to upload the
Bitmap directly without first saving it as a file?

Based on the link above, I think I just need to get the
FileInputStream from the Bitmap. But I don't know how ...

Thanks!

Ken
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question regarding MapActivity / MapView

2008-03-26 Thread Peter Stevenson

goro wrote:
 10x Vikram. I've forgot to set the permissions :(. now it works with
 the default gps folder. the problem is that it does not work with the
 test folder. I've created test like this: from the filexploerer in
 eclipse i've copied the gps folder to the desktop, i've renamed it to
 'test' and dragged it into /data/misc/location. it returns now :

 ERROR/JavaBinder(523): *** Uncaught remote exception!  (Exceptions are
 not yet supported across processes.)
 ERROR/JavaBinder(523): java.lang.IllegalArgumentException:
 provider=test
 ERROR/JavaBinder(523): at
 android.server.LocationManagerService.getProviderInfo(LocationManagerService.java:
 649)
 ERROR/JavaBinder(523): at android.location.ILocationManager
 $Stub.onTransact(ILocationManager.java:127)
 ERROR/JavaBinder(523): at
 android.os.Binder.execTransact(Binder.java:274)
 ERROR/JavaBinder(523): at android.dalvik.NativeStart.run(Native
 Method)

 Thata meens that I haven't created the test folder the right way. What
 am I doing wrong?


 On 24 Mrz., 20:05, vikram shetty [EMAIL PROTECTED] wrote:
   
 Have you set the permissions in the androidmanifest file

 uses-permission
 android:name=android.permission.ACCESS_LOCATION/uses-permission
 uses-permission
 android:name=android.permission.ACCESS_GPS/uses-permission
 uses-permission
 android:name=android.permission.ADD_SYSTEM_SERVICE/uses-permission

 Also, Have you tried putting break points and running this through a
 debugger and see exactly at what point you get the NullPointer
 Exception.

 Vikram

 On Mon, Mar 24, 2008 at 2:52 PM, goro [EMAIL PROTECTED] wrote:

 
  It has a kml file inside. if I use gps instead of test I get the same
  error.
   
  On 24 Mrz., 19:49, vikram shetty [EMAIL PROTECTED] wrote:
   Hi,
   
   Were you able to create the provider test or how did you create it?
   
   Vikram
   
 On Mon, Mar 24, 2008 at 2:41 PM, goro [EMAIL PROTECTED] wrote:
 
 Hi,
 Can you please share how did you fixed the Nullpointer problem because
   
 locationManager =
 (LocationManager)getSystemService(Context.LOCATION_SERVICE);
 try{
LocationProvider locationProvider =
 locationManager.getProvider(test);
Log.i(TAG,success);
 }catch(Exception se){
Log.i(TAG , se  + se.toString());
 }
   
 gives me null pointer exception
   
 On 11 Mrz., 06:16, Markiv [EMAIL PROTECTED] wrote:
  Hi Everybody,
   
  Thanks for all your suggestions. I was finally able to figure out 
 what
  was going on and took care of it.
   
  Sorry for not replying early. I was sick for a week. I am finally
  feeling 75% better.
   
  Vikram
   
  On Mar 4, 9:15 pm, Craig [EMAIL PROTECTED] wrote:
   
   Tele Atlas has a good demo for this 
 athttp://developerlink.teleatlas.com/pages/208_sample_applications.cfm
   
   If you're not interested in their registration process, you need 
 to
   get the LocationManager
   
 LocationManager locationManager =
   (LocationManager)getSystemService(Context.LOCATION_SERVICE);
   
   and you can pull your LocationProvider from that. Then you need to
   requestUpdates on the LocationManager using your 
 LocationProvider, and
   an extended IntentReceiver that overrides onReceiveIntent. The
   onReceiveIntent method gets an Intent as a parameter - you can do
   
 Location location = (Location)intent.getExtra(location);
   
   to get your Location.
   
   If you want to draw an icon at the Location you will probably also
   want to check out com.google.android.maps.Overlay.
   
   Hope that helps.
   
   -Craig
   
 

   
try this
adb push /your path/test  /data/misc/location/test/test


Peter

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

The android.intent.action.INSERT and android.intent.action.VIEW
actions are not broadcasts, they are actions for starting activities
to show a UI to insert a new entry, or view an existing entry,
respectively.  Thus you don't register for them with a receiver, you
launch them with startActivity().  (You can also write your own
activity implementing those actions to replace the standard UI, but
that's probably not what you are wanting.)

On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:
 Thanks Megha...But, will it be provided in the subsequent releases???

 Can you think of a situation where we would need this???

 Dexter.

 On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

  Hi,

  I don't think that the intents for contacts added and contacts deleted
  intents are broadcasted.
  So you cannot receive these intents.

  Thanks,
  Megha

  On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL PROTECTED]
  wrote:

   Hello All,

   I have an Intent Receiver which I will be triggered when a contact is
   added or deleted.

   My reciever properties in the androidmanifest.xml are as follows.

receiver android:name=.ContactAdded
  intent-filter
  action ndroid:name=android.intent.action.INSERT
   /
  action android:name=android.intent.action.VIEW
   /
  /intent-filter
  /receiver

   And in my Intent Reciever class, I have the following lines of code.

   public class ContactAdded {
  public void onReceiveIntent(Context context, Intent intent){
  try{
  Log.i(Received Intent, intent.getAction());
  }
  catch(Exception e){
  Log.i(Exception in Intent,e.getLocalizedMessage
   ());
  }
  }
   }

   Now, when I try to add or delete a contact, I can see in the LogCat
   that the required Intent is broadcast, but I don't see my message
   Received Intent in the LogCat which I have coded in my reciever
   class.

   Am I doing something wrong???

   Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to load a bitmap to a server directly?

2008-03-26 Thread Dan U.

So, it sounds like you have a Bitmap object. I assume you have some
server (http maybe?) set up to upload it to. Here's some code I use
for doing this:

HttpClient client = new HttpClient();
PostMethod method = new PostMethod(http://your_server/path/to/upload/
script);
Part[] parts = {
new FilePart(pictureFile, new 
ByteArrayPartSource(pictureFile,
getBytes(bitmap))),
};
method.setRequestEntity(new MultipartRequestEntity(parts,
method.getParams()));
client.executeMethod(method);
response = method.getResponseBodyAsString();
method.releaseConnection();

And getBytes(Bitmap):

ByteArrayOutputStream output = new ByteArrayOutputStream();
bitmap.compress(CompressFormat.PNG, 80, output);
return output.toByteArray();


On Mar 25, 11:02 pm, Ken [EMAIL PROTECTED] wrote:
 Hi there,

 I've followed this link and I know how to upload a file to a 
 server:http://www.anddev.org/upload_files_to_web_server-t443-s30.html

 However, let's say I've a Bitmap that I've received from the web, and
 I want to upload it to a server. Is there any ways to upload the
 Bitmap directly without first saving it as a file?

 Based on the link above, I think I just need to get the
 FileInputStream from the Bitmap. But I don't know how ...

 Thanks!

 Ken
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Garbage collector using huge amount of cpu time?

2008-03-26 Thread hackbod

If you don't have a debugger attached (I'm not sure how that might
change the behavior), this most likely means your application is
creating lots of temporary objects: almost 15,000 every 7 seconds.
I'm not aware of any bugs in the system that could cause an
application process to start doing this without being due to the
application itself, though of course there may be something.

Note that in Java it is really really easy to churn through lots of
temporary objects, especially with autoboxing and such; this is one of
the things you need to be careful about when programming for a mobile
device.

On Mar 25, 2:02 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 While our application is basically doing nothing the garbage collector
 is very busy:

 INFO/dalvikvm-heap(515): GC! (7789ms since last GC)
 INFO/dalvikvm-heap(515): GC old usage 58.3%; now 2.800MB used /
 4.800MB soft max (5.252MB real max)
 INFO/dalvikvm-heap(515): GC freed 14928 objects / 2095000 bytes in
 231ms
 INFO/dalvikvm-heap(515): GC! (7509ms since last GC)
 INFO/dalvikvm-heap(515): GC old usage 58.1%; now 2.790MB used /
 4.790MB soft max (5.252MB real max)
 INFO/dalvikvm-heap(515): GC freed 14883 objects / 2100932 bytes in
 193ms
 INFO/dalvikvm-heap(515): GC! (7496ms since last GC)
 INFO/dalvikvm-heap(515): GC old usage 58.4%; now 2.799MB used /
 4.799MB soft max (5.252MB real max)
 INFO/dalvikvm-heap(515): GC freed 14741 objects / 2086380 bytes in
 236ms
 INFO/dalvikvm-heap(515): GC! (7887ms since last GC)
 INFO/dalvikvm-heap(515): GC old usage 58.3%; now 2.799MB used /
 4.799MB soft max (5.252MB real max)
 INFO/dalvikvm-heap(515): GC freed 14899 objects / 2093612 bytes in
 199ms
 INFO/dalvikvm-heap(515): GC! (7444ms since last GC)
 INFO/dalvikvm-heap(515): GC old usage 58.3%; now 2.799MB used /
 4.799MB soft max (5.252MB real max)
 INFO/dalvikvm-heap(515): GC freed 14784 objects / 2096544 bytes in
 204ms

 As you can see every few seconds the GC is called and is using a
 decent fraction of a second to complete his task. Is this normal
 behaviour in the simulator, or is something going wrong?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: static method to get application context, resources, shared preferences

2008-03-26 Thread jim.renkel

The way I do it is:

class myActivity extends Activity {
public static Activity me = null;
...
protected void onCreate(Bundle icicle) {
 ...
me = this;
...
};
};

class myClass {
void myMthd() {
...
Intent  myIntnt = myActivity.me.getIntent();
...
};
};

Hope this helps.

Jim Renkel


On Mar 22, 1:04 pm, Raja Nagendra Kumar [EMAIL PROTECTED]
wrote:
 Nope.. I thought there should be some way as most of the new
 frameworks such as spring etc does have application level context to
 reduce refernce passing..

 Regards,
 Raja Nagendra Kumar,
 C.T.Owww.tejasoft.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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Arabic For Android

2008-03-26 Thread [EMAIL PROTECTED]

Peace be upon you

how are you guys, for Arabian Developer I have done a class that do
reshape for the Arabic text I hope that it is useful to you

here is link for the class

http://wm-arabic.cvs.sourceforge.net/wm-arabic/JAVA_Android_Version/

other related useful links

http://www.ahmed-essam.com/2007/11/applicability-for-arabizing-android.html
http://www.ahmed-essam.com/2007/12/how-do-arabization-works-idea-behind.html

Thanks for your time
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Question about Activity.onStop()

2008-03-26 Thread babyblue

Suppose Activity A is running. Then I called startActivity() from
another process which start Activity B. Then normally A.stop() will be
called. But if I write Activity B like this:

class B extends Activity{
  public void onCreate(Bundle ...){
 super.onCreate(...);
 finish();
  }
}
which means B finish itself once it was created. Then I noticed
A.stop() won't be called.
My question is:
1. Is it for sure A.stop() won't be called in this condition?
2. At after what step of B(B.onResume()? B.onStart()?) will A.stop()
be called? Is there any step sequence for certain?

Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] stand-alone notepad content provider insert error

2008-03-26 Thread logisic

played around with the original notepad example. split the code into 2
apps as follows: app NotePad(com.google.android.notepad) contains
NoteEditor.java, NotesList.java and TitleEditor.java. app
NoteProvider(com.google.provider) contains NotePad.java and
NotePadProvider.java.

installed the NoteProvider using adb, then launched NotePad from
eclipse. got to the main screen(empty notes list) fine but when Add
note is pressed, i get an error Unable to start activity
ComponentInfo {com.google.android.notepad/
com.google.android.notepad.NoteEditor}:
java.lang.NullPointerException.

what am i missing here, pls help. here is the logcat just in case:
I/ActivityManager(  517): Starting activity: Intent
{ action=android.intent.action.INSERT data=content://
com.google.provider.NotePad/notes comp={com.google.android.notepad/
com.google.android.notepad.NoteEditor} }
D/ActivityThread(  633): Performing launch of ActivityRecord{40047b00
[EMAIL PROTECTED] {com.google.android.notepad/
com.google.android.notepad.NoteEditor}}
D/dalvikvm(  633): Exception Ljava/lang/RuntimeException; from
ActivityThread.java:1758 not caught locally
D/dalvikvm(  633): Exception Ljava/lang/RuntimeException; from
ZygoteInit.java:1553 not caught locally
D/AndroidRuntime(  633): Shutting down VM
W/dalvikvm(  633): threadid=3: thread exiting with uncaught exception
(group=0x4000fdf8)
E/AndroidRuntime(  633): Uncaught handler: thread Main exiting due to
uncaught exception
E/AndroidRuntime(  633): java.lang.RuntimeException: Unable to start
activity ComponentInfo{com.google.android.notepad/
com.google.android.notepad.NoteEditor}: java.lang.NullPointerException
E/AndroidRuntime(  633):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1758)
E/AndroidRuntime(  633):at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1770)
E/AndroidRuntime(  633):at android.app.ActivityThread.access
$1500(ActivityThread.java:99)
E/AndroidRuntime(  633):at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1271)
E/AndroidRuntime(  633):at
android.os.Handler.dispatchMessage(Handler.java:80)
E/AndroidRuntime(  633):at android.os.Looper.loop(Looper.java:
91)
E/AndroidRuntime(  633):at
android.app.ActivityThread.main(ActivityThread.java:3052)
E/AndroidRuntime(  633):at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  633):at
java.lang.reflect.Method.invoke(Method.java:356)
E/AndroidRuntime(  633):at android.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:1547)
E/AndroidRuntime(  633):at
android.os.ZygoteInit.main(ZygoteInit.java:1445)
E/AndroidRuntime(  633):at
android.dalvik.NativeStart.main(Native Method)
E/AndroidRuntime(  633): Caused by: java.lang.NullPointerException
E/AndroidRuntime(  633):at
android.content.ContentProviderProxy.insert(ContentProviderNative.java:
355)
E/AndroidRuntime(  633):at
android.content.ContentResolver.insert(ContentResolver.java:287)
E/AndroidRuntime(  633):at
com.google.android.notepad.NoteEditor.onCreate(NoteEditor.java:131)
E/AndroidRuntime(  633):at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
847)
E/AndroidRuntime(  633):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1728)
E/AndroidRuntime(  633):... 11 more
I/Process (  517): Sending signal. PID: 633 SIG: 3
I/dalvikvm(  633): threadid=7: reacting to signal 3
I/dalvikvm(  633): DALVIK THREADS:
I/dalvikvm(  633): Main prio=5 tid=3 NATIVE
I/dalvikvm(  633):   | group=main sCount=1 dsCount=0 s=0
obj=0x40010450
I/dalvikvm(  633):   | sysTid=496 nice=0 sched=0/0 handle=-1090773764
I/dalvikvm(  633):   at android.os.BinderProxy.transact(Native Method)
I/dalvikvm(  633):   at
android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:
1441)
I/dalvikvm(  633):   at android.os.RuntimeInit.crash(RuntimeInit.java:
250)
I/dalvikvm(  633):   at android.os.RuntimeInit
$UncaughtHandler.uncaughtException(RuntimeInit.java:56)
I/dalvikvm(  633):   at
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:853)
I/dalvikvm(  633):   at
java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:850)
I/dalvikvm(  633):   (break frame)
I/dalvikvm(  633):   at android.dalvik.NativeStart.main(Native Method)
I/dalvikvm(  633):   (break frame)
I/dalvikvm(  633):
I/dalvikvm(  633): Binder Thread #2 prio=5 tid=13 NATIVE
I/dalvikvm(  633):   | group=main sCount=1 dsCount=0 s=0
obj=0x4006e0b8
I/dalvikvm(  633):   | sysTid=647 nice=-10 sched=0/0 handle=1314440
I/dalvikvm(  633):   at android.dalvik.NativeStart.run(Native Method)
I/dalvikvm(  633):   (break frame)
I/dalvikvm(  633):
I/dalvikvm(  633): Binder Thread #1 prio=5 tid=11 NATIVE
I/dalvikvm(  633):   | group=main sCount=1 dsCount=0 s=0
obj=0x4005b688
I/dalvikvm(  633):   | sysTid=646 nice=-10 sched=0/0 handle=1311160
I/dalvikvm(  633):   at 

[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread Amos

Hi Raja,

I think the following thread provides good info (although it's become
a bit long): 
http://groups.google.com/group/android-developers/browse_thread/thread/9632cb52888ef6db/9287a1a6a24ea577

Assuming you want to pass Objects between Activities in the *same*
application (i.e. same process), I believe that passing the Object
reference is better than Parceling it using the Intent Extras
mechanism (passing a pointer is obviously more efficient than
parceling/unparceling an object).
If the objects you are passing are relatively lightweight and few in
numbers - the performance difference is probably negligible.
If you want 2 activities to manipulate the *same* object and not 2
different copies of the same object - then you have to pass an object
reference between activities.

I faced this problem pretty early in my development effort, and came
up with the following mechanism:

I created a class called ReferencePasser that wraps a HashMap of
Objects, with Long keys. I have an instance of ReferencePasser
available to all Activities (as a public static field somewhere, or
through the Application object).

When an activity wants to pass an object to another activity, it adds
the object to ReferencePasser and gets a long key as a result. It then
passes this object key to the activity it is starting as an extra,
using some agreed-upon String key. When the called activity is
created, it retrieves the object key from its intent extras, and gets
the object reference from reference passer. It can then remove the
object from ReferencePasser to keep its Map small.

This approach has been working great for me so far, although obviously
it is limited to a single application process.
I'll attach sample code in the next thread.

Hope this helps,

Amos
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread Amos

Here is the sample code for passing Object references between
activities:

I have a class called ReferencePasser, which wraps a HashMap:

import java.util.HashMap;

/**
 * @author Amos
 * Maps Objects to keys.
 * The keys are generated automatically on insertion (based on a
running index).
 * Useful for passing references to objects.
 */
public class ReferencePasser {
private HashMapLong, Object _objects;
private long _nextKey;

public ReferencePasser() {
_objects = new HashMapLong, Object();
_nextKey = 1;
}

/**
 * Adds the given object to the map.
 * @param o
 * @return the key of object inserted.
 */
public long put(Object o) {
long key = _nextKey++;
_objects.put(Long.valueOf(key), o);
return key;
}

/**
 * @param key
 * @return the object with the given key, or null if 
key doesn't
exist in
 * the map.
 */
public Object get(long key) {
return _objects.get(Long.valueOf(key));
}

/**
 * Removes the object mapped to the given key from the 
map.
 * @param key
 */
public void remove(long key) {
_objects.remove(Long.valueOf(key));
}
}

Access to a single instance of ReferencePasser is achived through this
class:

public class GlobalStuff {
private static ReferencePasser _passer;

/**
 * Returns the application's ReferencePasser, which is 
useful for
passing
 * references to complex objects between Activities 
and/or
Services.
 * @return
 */
public static ReferencePasser getReferencePasser() {
if (_passer == null)
_passer = new ReferencePasser();
return _passer;
}
}

Here's a sample for an activity that wants to send an object to
another activity:

public class SourceActivity extends Activity {
...

private void startTargetActivity(SomeObject myObject) {
ReferencePasser passer = 
GlobalStuff.getReferencePasser();
long objectKey = passer.put(myObject);
Intent intent = new Intent(this, 
TargetActivity.class);
intent.putExtra(com.myapp.blabla, objectKey);
startActivity(intent);
}

...
}

And here's how the called activity gets the object that was passed to
it:

public class SourceActivity extends Activity {
protected void onCreate(Bundle icicle) {
//remember to handle null values, which I don't 
do here
long objectKey = 
getIntent().getLongExtra(com.myapp.blabla, 0);
ReferencePasser passer = 
GlobalStuff.getReferencePasser();
SomeObject passedObject = (SomeObject) 
passer.get(objectKey);
passer.remove(objectKey) //if I don't need the 
object reference
anymore

...
}

...
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] URL and socket closing

2008-03-26 Thread michael

Hi,

I have a problem about correctly closing the underlying socket after
opening and reading an input stream from a URL object. The following
code leaves many (i.e. all) sockets open (in the CLOSE_WAIT state, as
netstat reports):

private void test() {
for (int i = 0; i  1; i++) {
try {
String urlStr = http://test-url.com/?q=; + i;
URL url = new URL(urlStr);
InputStream is = url.openStream();
byte[] buffer = new byte[1024];
int len = is.read(buffer);
String content = ;
while (len != -1) {
content += new String(buffer, 0, len);
len = is.read(buffer);
}
is.close();
} catch (Exception e) {
Log.w(TAG,e);
}
Log.i(TAG, i:  + i);
}
}

As a consequence, no more sockets can be opened after a while. The
problem does not seem to occur when running the same code in a
normal java program (i.e. not in android). Am I missing something
here? Or is this problem due to a bug in android? How could I read
many URLs without running into this problem? (I want to query a web
service with lots of different parameters, that's why I need to open
that many connections.)

By the way: The problem only occurs, if the urlStr changes in each
loop.

Thanks for any hints,

Michael


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Diego Torres Milano

If you want to write your own activity implementing those actions, how
would you do that ?
Implementing a new whole ContactsProvider ?
If you only want to replace, say INSERT ?
How your new ContactsProvider can coexist with the standard one if you
want to extend its functionality ?

On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:
 The android.intent.action.INSERT and android.intent.action.VIEW
 actions are not broadcasts, they are actions for starting activities
 to show a UI to insert a new entry, or view an existing entry,
 respectively.  Thus you don't register for them with a receiver, you
 launch them with startActivity().  (You can also write your own
 activity implementing those actions to replace the standard UI, but
 that's probably not what you are wanting.)

 On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

  Thanks Megha...But, will it be provided in the subsequent releases???

  Can you think of a situation where we would need this???

  Dexter.

  On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

   Hi,

   I don't think that the intents for contacts added and contacts deleted
   intents are broadcasted.
   So you cannot receive these intents.

   Thanks,
   Megha

   On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL PROTECTED]
   wrote:

Hello All,

I have an Intent Receiver which I will be triggered when a contact is
added or deleted.

My reciever properties in the androidmanifest.xml are as follows.

 receiver android:name=.ContactAdded
   intent-filter
   action 
ndroid:name=android.intent.action.INSERT
/
   action android:name=android.intent.action.VIEW
/
   /intent-filter
   /receiver

And in my Intent Reciever class, I have the following lines of code.

public class ContactAdded {
   public void onReceiveIntent(Context context, Intent intent){
   try{
   Log.i(Received Intent, intent.getAction());
   }
   catch(Exception e){
   Log.i(Exception in Intent,e.getLocalizedMessage
());
   }
   }
}

Now, when I try to add or delete a contact, I can see in the LogCat
that the required Intent is broadcast, but I don't see my message
Received Intent in the LogCat which I have coded in my reciever
class.

Am I doing something wrong???

Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to associate my App with a file extension in the Browser

2008-03-26 Thread Amos

Hi,

I would like to implement the following scenario:

When a user browses a web page with Browser and clicks a link with a
special file extension (which is unique to my application, such as
www.mysite.com/somefile.xxx), that file will be downloaded and then
my application launched to view the downloaded file.

I'd like the browser to handle the file download if possible, and when
it's done start one of my activities and provide the  file to it.

This is desktop behavior and I'm not sure it conforms to the Android
intent/content provider way of doing things - but this is what I'd
like to happen.

Any ideas or pointers?

Thanks in advance,

Amos
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Polling internet, battery life Suggestion / Question?

2008-03-26 Thread Peli

Your idea sounds very useful. Indeed, it could be an idea that would
fit well into our project OpenIntents. I already suggested it as an
idea in our project group:
http://groups.google.com/group/openintents/browse_frm/thread/7f34fe99bd23c25
linking back to this discussion here, so feel free to add any
additional information there as well.

As of the real savings, I'm not so sure. Google seems to promote
always-on-networking, so the connection cost should not matter as it
would be a flatrate.

As for saving battery, one still has to transmit a certain amount of
data, so whether I transmit 3 minutes out of 15 minutes in a row, or 3
times 1 minute within 15 minutes does not obviously seem to make a
large difference in battery savings.

I imagine, there could be some savings if all services polled exactly
at the same time in parallel (to fill waiting gaps for individual
services) that could reduce the time say from 3 minutes for 3 services
to 1 1/2 minutes for 3 services, so the phone could sleep for 13 1/2
minutes which would make sense.

Peli

On Mar 25, 4:55 pm, Krishna(GK) [EMAIL PROTECTED] wrote:
 Hi,

 Connecting to internet continously or polling is likely to cause drain on
 battery. 
 (http://groups.google.com/group/android-developers/search?group=androi...
  ).

 Lots of people are going to write apps that poll server. Each one will need
 configuration on how often to poll. And user will have to configure in each
 app. If he configures every 15 min in 3 different apps and each start poll
 at a different point in time he will be connecting to the internet thrice
 every 15 min. Not nice.

 Suggestion

 1. Set up a Internet polling mechanism for polling the internet defaulting
 to every fifteen minutes. User can change this setting in one place. Allow
 services / apps to subscribe to this service. IPM(Internet polling
 mechanism) wakes up one service at a time. service polls internet does
 whatever it wants and goes back to sleep.

 Now each app has to initiate a connection and close it, which from my very
 basic understanding will slowdown the whole process and again drain battery.
 Instead IPM opens a socket and hands socket to each service round robin
 fashion. Service only indicates done. When all subscribers done IPM closes
 down connection.

 Question
 Does this make sense, I am no TCP stack or Mobile phone expert. Will
 somebody with more knowledge pitch in please.

 gk
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Question regarding MapActivity / MapView

2008-03-26 Thread goro

It just doesn't work. I see the directory and the files in the file
explorer and when i browse with the adb shell, but android doesn't see
the 'test' folder as a location provider, although it has exactly the
same files as the 'gps' folder. I tried another trick. I've removed
the files in the gps and replaced them with my own files, but when I
run I still get the default location in St. Francisco, instead of my
own in Germany. It seems that android ignores my updates of the /data/
misc/location folder.

On 26 Mrz., 07:08, Peter Stevenson [EMAIL PROTECTED] wrote:
 goro wrote:
  10x Vikram. I've forgot to set the permissions :(. now it works with
  the default gps folder. the problem is that it does not work with the
  test folder. I've created test like this: from the filexploerer in
  eclipse i've copied the gps folder to the desktop, i've renamed it to
  'test' and dragged it into /data/misc/location. it returns now :

  ERROR/JavaBinder(523): *** Uncaught remote exception!  (Exceptions are
  not yet supported across processes.)
  ERROR/JavaBinder(523): java.lang.IllegalArgumentException:
  provider=test
  ERROR/JavaBinder(523): at
  android.server.LocationManagerService.getProviderInfo(LocationManagerService.java:
  649)
  ERROR/JavaBinder(523): at android.location.ILocationManager
  $Stub.onTransact(ILocationManager.java:127)
  ERROR/JavaBinder(523): at
  android.os.Binder.execTransact(Binder.java:274)
  ERROR/JavaBinder(523): at android.dalvik.NativeStart.run(Native
  Method)

  Thata meens that I haven't created the test folder the right way. What
  am I doing wrong?

  On 24 Mrz., 20:05, vikram shetty [EMAIL PROTECTED] wrote:

  Have you set the permissions in the androidmanifest file

  uses-permission
  android:name=android.permission.ACCESS_LOCATION/uses-permission
  uses-permission
  android:name=android.permission.ACCESS_GPS/uses-permission
  uses-permission
  android:name=android.permission.ADD_SYSTEM_SERVICE/uses-permission

  Also, Have you tried putting break points and running this through a
  debugger and see exactly at what point you get the NullPointer
  Exception.

  Vikram

  On Mon, Mar 24, 2008 at 2:52 PM, goro [EMAIL PROTECTED] wrote:

   It has a kml file inside. if I use gps instead of test I get the same
   error.

   On 24 Mrz., 19:49, vikram shetty [EMAIL PROTECTED] wrote:
Hi,

Were you able to create the provider test or how did you create it?

Vikram

  On Mon, Mar 24, 2008 at 2:41 PM, goro [EMAIL PROTECTED] wrote:

  Hi,
  Can you please share how did you fixed the Nullpointer problem 
  because

  locationManager =
  (LocationManager)getSystemService(Context.LOCATION_SERVICE);
  try{
 LocationProvider locationProvider =
  locationManager.getProvider(test);
 Log.i(TAG,success);
  }catch(Exception se){
 Log.i(TAG , se  + se.toString());
  }

  gives me null pointer exception

  On 11 Mrz., 06:16, Markiv [EMAIL PROTECTED] wrote:
   Hi Everybody,

   Thanks for all your suggestions. I was finally able to figure out 
  what
   was going on and took care of it.

   Sorry for not replying early. I was sick for a week. I am finally
   feeling 75% better.

   Vikram

   On Mar 4, 9:15 pm, Craig [EMAIL PROTECTED] wrote:

Tele Atlas has a good demo for this 
  athttp://developerlink.teleatlas.com/pages/208_sample_applications.cfm

If you're not interested in their registration process, you 
  need to
get the LocationManager

  LocationManager locationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);

and you can pull your LocationProvider from that. Then you need 
  to
requestUpdates on the LocationManager using your 
  LocationProvider, and
an extended IntentReceiver that overrides onReceiveIntent. The
onReceiveIntent method gets an Intent as a parameter - you can 
  do

  Location location = (Location)intent.getExtra(location);

to get your Location.

If you want to draw an icon at the Location you will probably 
  also
want to check out com.google.android.maps.Overlay.

Hope that helps.

-Craig

 try this
 adb push /your path/test  /data/misc/location/test/test

 Peter
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Two emulators the same machine

2008-03-26 Thread Raja Nagendra Kumar

We see there are bugs in -d option..It is accepting any random device
name too and attaching it self to first found device.

adb -d dd logcat is accepted - as dd does not exist it should report
the issue..

In the interest of other developers the -d takes value 1 to 16 and not
the names which gets displayed

1   emulator-tcp-   device  0

Regards,
Nagendra

On Mar 26, 5:59 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
 From command line use

 $ adb devices

 to list your devices.
 Then

 $ adb -d dev install app

 to install app, and

 $ adb -d dev logcat

 to see the logs.

 On Mar 26, 1:29 am, Megha Joshi [EMAIL PROTECTED] wrote:



  Are you looking to do this using the Eclipse ADT plugin or through command
  line?

  On Tue, Mar 25, 2008 at 9:18 AM,RajaNagendraKumar

 [EMAIL PROTECTED] wrote:

   Hi,

   I would like to run two emulators and my application on each of these
   emulator on a single desktop. However my application would be using a
   different login for each of the emulator, so that I could demo the
   effect of one user changes to his data and how it impacts other user.

   I am able to start two emulators, however not having clues on how to
   install the application to each of these emulators and attach a log
   console to each of them. I understand there is some thing like port
   number, default port number etc.. Could one share their experience pl.

   Regards,
  RajaNagendraKumar,
   C.T.O
  www.tejasoft.com
   TejaSoft Simplified - A Logo to certifiy Software Simplicity- 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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] bug in onListItemClick call for the emulator with skin HVGA-L

2008-03-26 Thread Raja Nagendra Kumar

For the sub activities running on the mulator with skin -skin HVGA-L,
aListView or its selected item is coming as null. This could be a
proable bug on this skin.

protected void onListItemClick(final ListView aListView,
   final View aView,
   final int aPosition,
   final long aID)
{
if ((aListView != null)  (aListView.getSelectedItem() != null))
{
setResult(RESULT_OK, aListView.getSelectedItem().toString());
finish();
}
}

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ImageView - Translate Pixels from View to Bitmap

2008-03-26 Thread [EMAIL PROTECTED]

How can I translate a view x,y pixel to a x,y pixel in the Bitmap?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] adb push doesn't work

2008-03-26 Thread goro

Hi All,
I have the following probelem. when I type adb push in the console
nothing happens:

# push C:/Dokumente und Einstellungen/goro.GORO-6AF7A985DB/Desktop/
gps2 /data/m
isc/location/gps2
gives me a new line with '' as a cursor. If I type adb push instead
of simple push i have the same ''.
Can someone help me?
Thanx ,
Georgi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread Raja Nagendra Kumar
Hi Amos,

Thank you for the code libary to put and get java object refereces
across the components (i.e activities).
Based on hackbod comments, I am still not confused, why one has to do
so much for passing references, it is my intent is to pass them by
refence and the underllaying framework should manage this irrespective
of cross components, cross process etc.. I also hate impl. interfaces
such as Serialisable,parcelble etc..at least in this context as it is
one device and that to mobile device. I am sure having framework take
care of this would enable better memory and shortens the programing
logic.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

On Mar 26, 3:04 pm, Amos [EMAIL PROTECTED] wrote:
 Here is the sample code for passing Object references between
 activities:

 I have a class called ReferencePasser, which wraps a HashMap:

                 import java.util.HashMap;

                 /**
                  * @author Amos
                  * Maps Objects to keys.
                  * The keys are generated automatically on insertion (based 
 on a
 running index).
                  * Useful for passing references to objects.
                  */
                 public class ReferencePasser {
                         private HashMapLong, Object _objects;
                         private long _nextKey;

                         public ReferencePasser() {
                                 _objects = new HashMapLong, Object();
                                 _nextKey = 1;
                         }

                         /**
                          * Adds the given object to the map.
                          * @param o
                          * @return the key of object inserted.
                          */
                         public long put(Object o) {
                                 long key = _nextKey++;
                                 _objects.put(Long.valueOf(key), o);
                                 return key;
                         }

                         /**
                          * @param key
                          * @return the object with the given key, or null if 
 key doesn't
 exist in
                          * the map.
                          */
                         public Object get(long key) {
                                 return _objects.get(Long.valueOf(key));
                         }

                         /**
                          * Removes the object mapped to the given key from 
 the map.
                          * @param key
                          */
                         public void remove(long key) {
                                 _objects.remove(Long.valueOf(key));
                         }
                 }

 Access to a single instance of ReferencePasser is achived through this
 class:

                 public class GlobalStuff {
                         private static ReferencePasser _passer;

                         /**
                          * Returns the application's ReferencePasser, which 
 is useful for
 passing
                          * references to complex objects between Activities 
 and/or
 Services.
                          * @return
                          */
                         public static ReferencePasser getReferencePasser() {
                                 if (_passer == null)
                                         _passer = new ReferencePasser();
                                 return _passer;
                         }
                 }

 Here's a sample for an activity that wants to send an object to
 another activity:

                 public class SourceActivity extends Activity {
                 ...

                         private void startTargetActivity(SomeObject myObject) 
 {
                                 ReferencePasser passer = 
 GlobalStuff.getReferencePasser();
                                 long objectKey = passer.put(myObject);
                                 Intent intent = new Intent(this, 
 TargetActivity.class);
                                 intent.putExtra(com.myapp.blabla, 
 objectKey);
                                 startActivity(intent);
                         }

                 ...
                 }

 And here's how the called activity gets the object that was passed to
 it:

                 public class SourceActivity extends Activity {
                         protected void onCreate(Bundle icicle) {
                                 //remember to handle null values, which I 
 don't do here
                                 long objectKey = 
 getIntent().getLongExtra(com.myapp.blabla, 0);
                                 ReferencePasser passer = 
 GlobalStuff.getReferencePasser();
                                 SomeObject passedObject = (SomeObject) 
 passer.get(objectKey);
                                 passer.remove(objectKey) //if I don't need 
 the object reference
 anymore

                                 ...
    

[android-developers] Re: Null pointer exception when finding views by Id

2008-03-26 Thread kaiping

Thanks for the idea.  I have confirmed that the file is named
transaction_edit.xml.

On Mar 26, 3:54 am, Dan U. [EMAIL PROTECTED] wrote:
 Well, he needs to have the filename be transaction_edit.xml. Not sure
 if it is.

 On Mar 25, 5:29 am, Rick Genter [EMAIL PROTECTED] wrote:

  Don't you need to name your layout transaction_edit in the XML file?

  On Mar 25, 2008, at 5:26 AM,kaipingwrote:

   Hi, For one of my Activities All the findViewById() function returns
   is null.  I am really astonished by this behaviour because this same
   function works fine in other parts of my application.  I have posted
   the code below.  If anybody has any ideas that would be great thanks,

   Josh

   package com.jingsys.money;

   import java.util.ArrayList;

   import android.app.Activity;
   import android.database.Cursor;
   import android.os.Bundle;
   import android.widget.ArrayAdapter;
   import android.widget.DatePicker;
   import android.widget.EditText;
   import android.widget.Spinner;

   import com.jingsys.money.data.AccountsDbAdapter;
   import com.jingsys.money.data.MoneyDbAdapterFactory;
   import com.jingsys.money.data.TransactionDbAdapter;

   public class EditTransaction extends Activity {

  private  DatePicker mDate;
  private  EditText mDescription;
  private  EditText mNumber;
  private  EditText mAmount;
  private  Spinner mFromAccount;
  private  Spinner mToAccount;
  private  EditText mComments;

  private TransactionDbAdapter transData;
  private AccountsDbAdapter accountData;

  private Cursor mFrom;
  private Cursor mTo;

  @Override
  protected void onCreate(Bundle icicle) {
  super.onCreate(icicle);
  setContentView(R.layout.transaction_edit);

  mDate = (DatePicker) findViewById(R.id.trans_date);
  mDescription = (EditText) findViewById(R.id.account_name);
  mNumber = (EditText) findViewById(R.id.trans_number);
  mAmount = (EditText) findViewById(R.id.trans_amount);
  mComments = (EditText) findViewById(R.id.trans_comments);

  mFromAccount = (Spinner) findViewById(R.id.trans_from);
  mToAccount = (Spinner) findViewById(R.id.trans_to);

   XML file
   ?xml version=1.0 encoding=UTF-8?
   TableLayout xmlns:android=http://schemas.android.com/apk/res/
   android
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:stretchColumns=1
  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_date /
  DatePicker android:id=@+id/trans_date
android:layout_width=wrap_content
  android:layout_height=wrap_content /
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_description /
  EditText android:id=@+id/trans_descr
  android:layout_width=wrap_content
  android:layout_height=wrap_content/
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_number/
  EditText android:id=@+id/trans_number
  android:layout_width=wrap_content
  android:layout_height=wrap_content/
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_amount/
  EditText android:id=@+id/trans_amount
  android:layout_width=wrap_content
  android:layout_height=wrap_content/
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_from/
  Spinner android:id=@+id/trans_from
  android:layout_width=wrap_content
  android:layout_height=fill_parent/
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_to/
  Spinner android:id=@+id/trans_to
  android:layout_width=wrap_content
  android:layout_height=fill_parent/
  /TableRow

  TableRow
  TextView android:layout_width=wrap_content
  android:layout_height=wrap_content
  android:text=@string/transaction_comments/
  EditText android:id=@+id/trans_comments
  

[android-developers] Re: Two emulators the same machine

2008-03-26 Thread Diego Torres Milano

You may be interested in this post (http://groups.google.com/group/
android-developers/msg/642de3ec8031178a) too (adb parsing command line
options).

On Mar 26, 12:38 pm, Raja Nagendra Kumar [EMAIL PROTECTED]
wrote:
 We see there are bugs in -d option..It is accepting any random device
 name too and attaching it self to first found device.

 adb -d dd logcat is accepted - as dd does not exist it should report
 the issue..

 In the interest of other developers the -d takes value 1 to 16 and not
 the names which gets displayed

 1   emulator-tcp-   device  0

 Regards,
 Nagendra

 On Mar 26, 5:59 am, Diego Torres Milano [EMAIL PROTECTED] wrote:

  From command line use

  $ adb devices

  to list your devices.
  Then

  $ adb -d dev install app

  to install app, and

  $ adb -d dev logcat

  to see the logs.

  On Mar 26, 1:29 am, Megha Joshi [EMAIL PROTECTED] wrote:

   Are you looking to do this using the Eclipse ADT plugin or through command
   line?

   On Tue, Mar 25, 2008 at 9:18 AM,RajaNagendraKumar

  [EMAIL PROTECTED] wrote:

Hi,

I would like to run two emulators and my application on each of these
emulator on a single desktop. However my application would be using a
different login for each of the emulator, so that I could demo the
effect of one user changes to his data and how it impacts other user.

I am able to start two emulators, however not having clues on how to
install the application to each of these emulators and attach a log
console to each of them. I understand there is some thing like port
number, default port number etc.. Could one share their experience pl.

Regards,
   RajaNagendraKumar,
C.T.O
   www.tejasoft.com
TejaSoft Simplified - A Logo to certifiy Software Simplicity- 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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: adb logcat -f out.log doesn't work?

2008-03-26 Thread Raja Nagendra Kumar

Hi,

May be there are big issues in the arguments checking in sdk tools.

adb logcat APP_FILTER_TAG or
emulator  -logcat APP_FILTER_TAG does not seem to work as expected. I
am still seeing all the log messages which are of different tag than
APP_FILTER_TAG.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

On Mar 26, 6:23 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
 I was tempted to tell you that in your case '-f out.log' is
 interpreted by adb as a filter, but if you invoke

 $ adb logcat -f '*'

 you'll obtain

 couldn't open output file: Is a directory

 so, it's not a filter expression really.
 adb is not parsing its command line correctly.

 On Mar 24, 1:55 pm, [EMAIL PROTECTED] wrote: I tried to use adb logcat -f 
 filename to redirect the log message
  to a log file. Then I don't need to watch logs in windows cmd window.
  Is that correct to use like adb logcat -f out.log? There is no
  out.log file created in the same directory.
  Or I tried the wrong direction?

  Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Call unblockContact(contact)

2008-03-26 Thread David HK

I have tested android-sdk_m5-rc15_windows\samples\ApiDemos\src\com
\google\android\samples\app\GTalkDataMessageSender.java

I have two gmail accounts: [EMAIL PROTECTED](on emulator A) ,[EMAIL 
PROTECTED](on
emulator B)

At first,I sent message from A to B,it doesn't work.
Then I went to the web gmail using [EMAIL PROTECTED],inviting [EMAIL PROTECTED] 
to
chat with.
after [EMAIL PROTECTED] accetpped the chat,I sent message to [EMAIL PROTECTED] 
on
emulator A again,It works.

But I am making a program that will send a message to a new contact,if
I am not in his buddylist,he will never get my message,right?



I found this page:
http://code.google.com/android/reference/com/google/android/gtalkservice/IGTalkSession.html#createChatSession(java.lang.String)

public void blockContact(String contact)
Blocks the contact from subscribing to user's presence or sending the
user messages. The contact is put on the blocked list, and is no
longer visible in the roster.

public IChatSession createChatSession(String to)
Create a ChatSession with the specified contact.

public void removeContact(String contact)
Remove the contact from the roster. This also removes the presence
subscription to the contact.

public void unblockContact(String contact)
Unblocks the contact from blocked list.



My question is
if I want to send a message to a new friend,I should call
unblockContact(contact) first? or maybe there is a bug in
GTalkDataMessageSender.java

Regards
David




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] What is Android? diagram in docs.

2008-03-26 Thread szeldon

Hi,

My question is a little silly one, but I wonder why on diagram at
http://code.google.com/android/what-is-android.html
the Android Runtime layer is not between Application Framework and
Libraries? Is this because Android Runtime uses kernel's functionality
for threading and low-level memory management? So why this Runtime
layer is not touching the Linux Kernel on this diagram? Don't get me
wrong, I'm not trying to critisize this. I think docs are great there
but I think that this could help me understand how the virtual machine
works.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: adb push doesn't work

2008-03-26 Thread goro

Probelm solved.
I have tries push from whithin the adb console instead of from the
windows shell

On 26 Mrz., 14:03, goro [EMAIL PROTECTED] wrote:
 Hi All,
 I have the following probelem. when I type adb push in the console
 nothing happens:

 # push C:/Dokumente und Einstellungen/goro.GORO-6AF7A985DB/Desktop/
 gps2 /data/m
 isc/location/gps2
 gives me a new line with '' as a cursor. If I type adb push instead
 of simple push i have the same ''.
 Can someone help me?
 Thanx ,
 Georgi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: What is Android? diagram in docs.

2008-03-26 Thread [EMAIL PROTECTED]

I guess.

Runtime is fundamentally on the side. Think of runtime as the CPU
for code written in Java: apps use the runtime directly, java
framework libraries use the runtime directly. Diagram would be better
if runtime went to top all the way.

JNI allows to go directly from application framework to libraries
without going through runtime.

Runtime doesn't work directly with kernel (would be very unusual),
probably goes through libc, kernel interface is specific to CPU and
not portable.

On Mar 26, 6:59 am, szeldon [EMAIL PROTECTED] wrote:
 Hi,

 My question is a little silly one, but I wonder why on diagram 
 athttp://code.google.com/android/what-is-android.html
 the Android Runtime layer is not between Application Framework and
 Libraries? Is this because Android Runtime uses kernel's functionality
 for threading and low-level memory management? So why this Runtime
 layer is not touching the Linux Kernel on this diagram? Don't get me
 wrong, I'm not trying to critisize this. I think docs are great there
 but I think that this could help me understand how the virtual machine
 works.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: help- 670 errors :( R cannot be resolved

2008-03-26 Thread hmmmmm

yes offcourse

On Mar 26, 10:13 pm, Dan U. [EMAIL PROTECTED] wrote:
 Was your project created as an Android project?

 On Mar 26, 7:58 am, hm [EMAIL PROTECTED] wrote:

  hi
  im a late comer in adc.

  im getting a problem while running the api demo in the sample
  it is generating 670 errors 69 warnings

  the main error is R cannot be resolved.
  im not able to find the R.java while creating the project from the
  given source.
  im using Eclipse 3.3.1 M5 Windows.

  i create some sample other apps but did not face any error like this.
  i tried to fixed it from the Android ToolsFixed Projects Properties.
  but it didnt fixed

  best regards
  hm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Picture and Buttons for different screen size

2008-03-26 Thread vitvikt

Thanks, Megha

 The QVGA-L and QVGA-P modes are not supported in the m5 SDK. Your
 application may still use them, but may face some issues with layout.
 It is recommended  to use HVGA-L and HVGA-P modes.
I used it only for test. Do you know about another emulators with
another screen size?


 You can set the layout_height programatically using the LayoutParams
 class.http://code.google.com/android/reference/android/widget/LinearLayout
Thanks. I did it.

  If you want to do this programatically, try using the constructor:
  ProgressDialog pd = new ProgressDialog(this,
 android.R.styleable.Theme_progressBarStyleHorizontal);
I couldn't do it. OK. Now I decided forget about ProgressBar.
I used ProgressBar and ProgressDialog at the same time, when I used
xml layouts, but now I decided  use only ProgressDialog, if it is so
difficult or unimpossible to create ProgressBar programmly.

Thank you very much.
Vitaly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: help- 670 errors :( R cannot be resolved

2008-03-26 Thread Dan U.

It sounds like something is corrupted. I'd recommend creating a new
project and moving everything over to that one.

On Mar 26, 9:27 am, hm [EMAIL PROTECTED] wrote:
 yes offcourse

 On Mar 26, 10:13 pm, Dan U. [EMAIL PROTECTED] wrote:

  Was your project created as an Android project?

  On Mar 26, 7:58 am, hm [EMAIL PROTECTED] wrote:

   hi
   im a late comer in adc.

   im getting a problem while running the api demo in the sample
   it is generating 670 errors 69 warnings

   the main error is R cannot be resolved.
   im not able to find the R.java while creating the project from the
   given source.
   im using Eclipse 3.3.1 M5 Windows.

   i create some sample other apps but did not face any error like this.
   i tried to fixed it from the Android ToolsFixed Projects Properties.
   but it didnt fixed

   best regards
   hm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: help- 670 errors :( R cannot be resolved

2008-03-26 Thread hmmmmm

thnx dan for your reply

I have done several times creating a new projects in eclipse through
linking the Api Demo in the sample
but every time im sawing this error.
:((
what would i do now
R.java is an autogenerated file

could i make it myself??
could you share your R.java of the Api demo sample here so that i can
copy paste that
would this approach will work


On Mar 26, 10:47 pm, Dan U. [EMAIL PROTECTED] wrote:
 It sounds like something is corrupted. I'd recommend creating a new
 project and moving everything over to that one.

 On Mar 26, 9:27 am, hm [EMAIL PROTECTED] wrote:

  yes offcourse

  On Mar 26, 10:13 pm, Dan U. [EMAIL PROTECTED] wrote:

   Was your project created as an Android project?

   On Mar 26, 7:58 am, hm [EMAIL PROTECTED] wrote:

hi
im a late comer in adc.

im getting a problem while running the api demo in the sample
it is generating 670 errors 69 warnings

the main error is R cannot be resolved.
im not able to find the R.java while creating the project from the
given source.
im using Eclipse 3.3.1 M5 Windows.

i create some sample other apps but did not face any error like this.
i tried to fixed it from the Android ToolsFixed Projects Properties.
but it didnt fixed

best regards
hm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread hackbod

It is because the process can be killed when your application goes to
the background, so the system needs to be able to hold on to any
objects in its own process, to be able to return them to you in the
event of you being killed and restarted.

Note that due to this behavior, the approach suggested by Amos is
problematic -- if you go into the background and your process gets
killed, when your activity is later restarted the ReferencePasser will
be empty and you will no longer be able to retrieve anything from it.

On Mar 26, 6:17 am, Raja Nagendra Kumar [EMAIL PROTECTED]
wrote:
 Hi Amos,

 Thank you for the code libary to put and get java object refereces
 across the components (i.e activities).
 Based on hackbod comments, I am still not confused, why one has to do
 so much for passing references, it is my intent is to pass them by
 refence and the underllaying framework should manage this irrespective
 of cross components, cross process etc.. I also hate impl. interfaces
 such as Serialisable,parcelble etc..at least in this context as it is
 one device and that to mobile device. I am sure having framework take
 care of this would enable better memory and shortens the programing
 logic.

 Regards,
 Raja Nagendra Kumar,
 C.T.Owww.tejasoft.com

 On Mar 26, 3:04 pm, Amos [EMAIL PROTECTED] wrote:

  Here is the sample code for passing Object references between
  activities:

  I have a class called ReferencePasser, which wraps a HashMap:

  import java.util.HashMap;

  /**
   * @author Amos
   * Maps Objects to keys.
   * The keys are generated automatically on insertion (based 
  on a
  running index).
   * Useful for passing references to objects.
   */
  public class ReferencePasser {
  private HashMapLong, Object _objects;
  private long _nextKey;

  public ReferencePasser() {
  _objects = new HashMapLong, Object();
  _nextKey = 1;
  }

  /**
   * Adds the given object to the map.
   * @param o
   * @return the key of object inserted.
   */
  public long put(Object o) {
  long key = _nextKey++;
  _objects.put(Long.valueOf(key), o);
  return key;
  }

  /**
   * @param key
   * @return the object with the given key, or null 
  if key doesn't
  exist in
   * the map.
   */
  public Object get(long key) {
  return _objects.get(Long.valueOf(key));
  }

  /**
   * Removes the object mapped to the given key from 
  the map.
   * @param key
   */
  public void remove(long key) {
  _objects.remove(Long.valueOf(key));
  }
  }

  Access to a single instance of ReferencePasser is achived through this
  class:

  public class GlobalStuff {
  private static ReferencePasser _passer;

  /**
   * Returns the application's ReferencePasser, which 
  is useful for
  passing
   * references to complex objects between Activities 
  and/or
  Services.
   * @return
   */
  public static ReferencePasser getReferencePasser() {
  if (_passer == null)
  _passer = new ReferencePasser();
  return _passer;
  }
  }

  Here's a sample for an activity that wants to send an object to
  another activity:

  public class SourceActivity extends Activity {
  ...

  private void startTargetActivity(SomeObject 
  myObject) {
  ReferencePasser passer = 
  GlobalStuff.getReferencePasser();
  long objectKey = passer.put(myObject);
  Intent intent = new Intent(this, 
  TargetActivity.class);
  intent.putExtra(com.myapp.blabla, 
  objectKey);
  startActivity(intent);
  }

  ...
  }

  And here's how the called activity gets the object 

[android-developers] Re: How to associate my App with a file extension in the Browser

2008-03-26 Thread hackbod

All of Android's file mappings are based on MIME types.  As long as
your web server is returning the correct MIME type, you can implement
an activity that says it knows how to VIEW that MIME type and it will
be launched when the user clicks on such a file after downloading it.

On Mar 26, 3:34 am, Amos [EMAIL PROTECTED] wrote:
 Hi,

 I would like to implement the following scenario:

 When a user browses a web page with Browser and clicks a link with a
 special file extension (which is unique to my application, such as
 www.mysite.com/somefile.xxx), that file will be downloaded and then
 my application launched to view the downloaded file.

 I'd like the browser to handle the file download if possible, and when
 it's done start one of my activities and provide the  file to it.

 This is desktop behavior and I'm not sure it conforms to the Android
 intent/content provider way of doing things - but this is what I'd
 like to happen.

 Any ideas or pointers?

 Thanks in advance,

 Amos
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

ok...Let me tell you what i wanted to doI have a local file that
has information about all the contacts on the phone. And my
application uses this local file and not the phone book data
directly

So I wanted that, whenever a new contact is added or an old one is
deleted, I should run a program that would update this local file .
But this seems to be impossible right now if there's no intent for
this. I will have to do a check for changes in the phone book and
update my local file, everytime my application startsThats a bit
of overhead on my appand will also affect the startup time...

hackbod wrote:
 No, it has nothing to do with writing a contacts provider.  The
 provider is the back-end data; an activity is the user interface.  You
 just write a new activity that operates on the existing content
 provider.

 On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
  If you want to write your own activity implementing those actions, how
  would you do that ?
  Implementing a new whole ContactsProvider ?
  If you only want to replace, say INSERT ?
  How your new ContactsProvider can coexist with the standard one if you
  want to extend its functionality ?
 
  On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:
 
   The android.intent.action.INSERT and android.intent.action.VIEW
   actions are not broadcasts, they are actions for starting activities
   to show a UI to insert a new entry, or view an existing entry,
   respectively.  Thus you don't register for them with a receiver, you
   launch them with startActivity().  (You can also write your own
   activity implementing those actions to replace the standard UI, but
   that's probably not what you are wanting.)
 
   On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:
 
Thanks Megha...But, will it be provided in the subsequent releases???
 
Can you think of a situation where we would need this???
 
Dexter.
 
On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:
 
 Hi,
 
 I don't think that the intents for contacts added and contacts deleted
 intents are broadcasted.
 So you cannot receive these intents.
 
 Thanks,
 Megha
 
 On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL PROTECTED]
 wrote:
 
  Hello All,
 
  I have an Intent Receiver which I will be triggered when a contact 
  is
  added or deleted.
 
  My reciever properties in the androidmanifest.xml are as follows.
 
   receiver android:name=.ContactAdded
 intent-filter
 action 
  ndroid:name=android.intent.action.INSERT
  /
 action 
  android:name=android.intent.action.VIEW
  /
 /intent-filter
 /receiver
 
  And in my Intent Reciever class, I have the following lines of code.
 
  public class ContactAdded {
 public void onReceiveIntent(Context context, Intent intent){
 try{
 Log.i(Received Intent, intent.getAction());
 }
 catch(Exception e){
 Log.i(Exception in 
  Intent,e.getLocalizedMessage
  ());
 }
 }
  }
 
  Now, when I try to add or delete a contact, I can see in the LogCat
  that the required Intent is broadcast, but I don't see my message
  Received Intent in the LogCat which I have coded in my reciever
  class.
 
  Am I doing something wrong???
 
  Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Graphics performance

2008-03-26 Thread David Given

Hello,

I'm trying to write some highly graphics-intensive code. It's basically 
rendering into a pixel array (int[]), which I want to slam onto the 
screen as quickly as possible.

What I'm seeing is rather disappointing. What I'm doing is copying the 
pixel array into a Bitmap object using Bitmap.setPixels(), and then 
drawing the Bitmap using a custom View class; the data's actually being 
produced from another thread, so there's also a postInvalidate() in 
there. Full screen, with a dummy drawing routine that just fills the 
array with garbage, this is maxing out at 25fps while using 100% CPU time.

Does anyone have any suggestions as to what I might be able to do to 
speed things up? For example, is it possible to bypass the compositing 
layer somehow, which has *got* to be hurting things? Is there any way of 
getting the Bitmap's internal pixel store, so I can draw into that and 
save a copy? Any suggestions?

-- 
David Given
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread Raja Nagendra Kumar

Hackbod,

I clearly understand this swapping approach to release the resources
and memory. But question is why the framework can't handle this
transperently i.e transperently storing the object status of
background process it is killing and getting it back with out
programmer need to take care of such situations.. Pl. look at as
general comments and not only perticular to andorid alone. Trying to
see some thoughts based on my expertise with spring,where interfaces
does not matter for it do interception etc..

Regards,
Nagendra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Telephony API?

2008-03-26 Thread GaryH

All:

I have read a number of post about not being able to intercept
incoming calls, get the outgoing call in real time, and a number of
other phone features which one would expect to be present in an open
system.

Without muddling the waters more than they already are around this
issue, my question is directly aimed at Google. This question and
request has been asked before, however, I have not seen any direct
response todate.

Q: With the platform being toughted as open, why then would you hide
or otherwise make certain features which many (read as a good
majority) of the developers seek or need. Certain basic phone features
are very useful in such a wide variety of applications.

Aside form perhaps some of the obvious commercial reasons, what are
the plans to make incercepting incoing call information, outgoing call
information and a number of other call features which other developers
have inquired about available?

I think there have been many formal and informal request along this
line... so whats the answer?

Gary
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Incoming call data

2008-03-26 Thread GaryH

I think we'll know the real answer as to why the API is incomplete or
not exposed once the first few hardware devices are relased and
operational. Actions tend to speak volumes and I have nott much
credible lip service given to this topic by Google. Would be nice to
see a solid response with a tangible outcome. Google?

Gary
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Coding conventions

2008-03-26 Thread Dan U.

I'm researching coding conventions for Android. It seems that
following standard Java conventions is a good thing. Are there any
Android-specific conventions? I already know about the guidelines for
performance. I'm more concerned with things like variable naming. I
notice a lot of instance variables start with lowercase m, but I don't
understand the significance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Peli

Could a ContentObserver be registered for cases like these?
http://code.google.com/android/reference/android/database/ContentObserver.html
http://code.google.com/android/reference/android/content/ContentResolver.html#notifyChange(android.net.Uri,%20android.database.ContentObserver)

Peli

On Mar 26, 6:02 pm, Dexter's Brain [EMAIL PROTECTED] wrote:
 ok...Let me tell you what i wanted to doI have a local file that
 has information about all the contacts on the phone. And my
 application uses this local file and not the phone book data
 directly

 So I wanted that, whenever a new contact is added or an old one is
 deleted, I should run a program that would update this local file .
 But this seems to be impossible right now if there's no intent for
 this. I will have to do a check for changes in the phone book and
 update my local file, everytime my application startsThats a bit
 of overhead on my appand will also affect the startup time...

 hackbod wrote:
  No, it has nothing to do with writing a contacts provider.  The
  provider is the back-end data; an activity is the user interface.  You
  just write a new activity that operates on the existing content
  provider.

  On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
   If you want to write your own activity implementing those actions, how
   would you do that ?
   Implementing a new whole ContactsProvider ?
   If you only want to replace, say INSERT ?
   How your new ContactsProvider can coexist with the standard one if you
   want to extend its functionality ?

   On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:

The android.intent.action.INSERT and android.intent.action.VIEW
actions are not broadcasts, they are actions for starting activities
to show a UI to insert a new entry, or view an existing entry,
respectively.  Thus you don't register for them with a receiver, you
launch them with startActivity().  (You can also write your own
activity implementing those actions to replace the standard UI, but
that's probably not what you are wanting.)

On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

 Thanks Megha...But, will it be provided in the subsequent releases???

 Can you think of a situation where we would need this???

 Dexter.

 On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

  Hi,

  I don't think that the intents for contacts added and contacts 
  deleted
  intents are broadcasted.
  So you cannot receive these intents.

  Thanks,
  Megha

  On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL PROTECTED]
  wrote:

   Hello All,

   I have an Intent Receiver which I will be triggered when a 
   contact is
   added or deleted.

   My reciever properties in the androidmanifest.xml are as follows.

receiver android:name=.ContactAdded
  intent-filter
  action 
   ndroid:name=android.intent.action.INSERT
   /
  action 
   android:name=android.intent.action.VIEW
   /
  /intent-filter
  /receiver

   And in my Intent Reciever class, I have the following lines of 
   code.

   public class ContactAdded {
  public void onReceiveIntent(Context context, Intent 
   intent){
  try{
  Log.i(Received Intent, 
   intent.getAction());
  }
  catch(Exception e){
  Log.i(Exception in 
   Intent,e.getLocalizedMessage
   ());
  }
  }
   }

   Now, when I try to add or delete a contact, I can see in the 
   LogCat
   that the required Intent is broadcast, but I don't see my message
   Received Intent in the LogCat which I have coded in my reciever
   class.

   Am I doing something wrong???

   Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Problem with IDs in R.java

2008-03-26 Thread tim.chittka

Hello,
I work on a Android project, for which I provided several new view
components. Some of those are however rather general, e.g. a slider. I
would put these components gladly in a jar to make them available to
others. However I have the problem that the components using pngs from
the drawable directory and that those are referenced only via ID in
the R.java. If I export the project as a jar and bind it into another
android project, the components don't use the pngs in the jar but the
pngs referenced via ID in the R.java of the destination project.

Best regards,
Tim

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: webservice using ksoap2 in android

2008-03-26 Thread Kasas

If there is no way to put a timeout in the call, u should use a thread
to call it, and in the main thread just wait 6 second before check if
the webservice call has an answer. Unless it does, you should kill
that thread...

On Mar 18, 9:12 am, Florindo Renso [EMAIL PROTECTED] wrote:
 Thx :-)

 On Tue, Mar 18, 2008 at 9:06 AM, chitgoks [EMAIL PROTECTED] wrote:

  ok i hope someone else can help you. you probably need a Thread with this.
  and I havent touched Threads in android yet

  On Tue, Mar 18, 2008 at 4:04 PM, Florindo Renso [EMAIL PROTECTED]
  wrote:

   my code is just in a try catch ...
   My problem is this:

   I need to create a connection timeout that after 6 seconds without
   reciving a reply from the server close the connection and throws and
   eception. Actually happen that my apllication remains blocked and the call
   of the webservice, waiting the reply for a indeterminate time, so if for
   some problem the webservice don't give a reply to the call the applicazion
   was blocked in a infinite loop.
   I hope to be clear this time
   thx

   --
  Website:http://chitgoks.freehostia.com
  Java Casino Games:http://chitgoks.tripod.com
  My Blogs:
 http://chitgoks.blogspot.com
 http://wuhtevah.blogspot.com
 http://disneyusa.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Good example for showing exchanging of data mostly arrays or non premitive data types,objects

2008-03-26 Thread [EMAIL PROTECTED]

How would you want to make it more transparant?

If you want to kill activities when they are in the background and
restore them when the user wants to see it again you have to save the
state of the objects. Saving the state of objects is only possible if
you marshal the object. If you only have a pointer to an object
'owned' by another activity you can't save the object to disk.

- If you save the reference the reference may be invalid by the time
the activity returns.
- If you save the object the other activity still needs to be able to
access that object

So there is really no other way then to duplicate the object (using
parceble) when you want to use the same data in multiple activies, or
you have to use a seperate shared data source such as a content
provider, or you have to create some other strategy where you make
sure the data stays consistent.

On Mar 26, 6:08 pm, Raja Nagendra Kumar [EMAIL PROTECTED]
wrote:
 Hackbod,

 I clearly understand this swapping approach to release the resources
 and memory. But question is why the framework can't handle this
 transperently i.e transperently storing the object status of
 background process it is killing and getting it back with out
 programmer need to take care of such situations.. Pl. look at as
 general comments and not only perticular to andorid alone. Trying to
 see some thoughts based on my expertise with spring,where interfaces
 does not matter for it do interception etc..

 Regards,
 Nagendra
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Graphics performance

2008-03-26 Thread [EMAIL PROTECTED]

It think graphic performance is very limited due to the use of an
emulator. Real phones will almost certainly have hardware accelerated
2d-graphics (and probably also 3d).

On Mar 26, 6:03 pm, David Given [EMAIL PROTECTED] wrote:
 Hello,

 I'm trying to write some highly graphics-intensive code. It's basically
 rendering into a pixel array (int[]), which I want to slam onto the
 screen as quickly as possible.

 What I'm seeing is rather disappointing. What I'm doing is copying the
 pixel array into a Bitmap object using Bitmap.setPixels(), and then
 drawing the Bitmap using a custom View class; the data's actually being
 produced from another thread, so there's also a postInvalidate() in
 there. Full screen, with a dummy drawing routine that just fills the
 array with garbage, this is maxing out at 25fps while using 100% CPU time.

 Does anyone have any suggestions as to what I might be able to do to
 speed things up? For example, is it possible to bypass the compositing
 layer somehow, which has *got* to be hurting things? Is there any way of
 getting the Bitmap's internal pixel store, so I can draw into that and
 save a copy? Any suggestions?

 --
 David Given
 [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to post a new key event?

2008-03-26 Thread Cheryl Sedota

I am developing an on-screen keyboard activity and need to post a key
event to Android.  I can't figure out how to do it.

I've intercepted some key events to see what Android methods are on
the stack, and it seems that I need to call getParent() from my view
until I get to the view root (android.view.ViewRoot, which is not an
accessible class in Android application code) and then call this
method:

   public void dispatchKey(KeyEvent event)

... I tried calling that method on my view root object using java
reflection and passed the key event object that I created.  That call
was successful but no new text shows up in my EditText control which
is located within the keyboard activity.

My first goal is for the EditText control that is located within the
keyboard activity (which maintains focus even while the key image is
pressed) to show the text that I have entered using the keyboard.

My second goal is for an EditText control that is in the Activity
behind my keyboard activity to show the text that I have entered using
the keyboard.

I appreciate any help anyone can provide!!
Cheryl
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Activity neutral entry point for an Android application?

2008-03-26 Thread Jakob Bjerre Jensen

Hello hackbod,

That is exactly, what I was looking for! Thanks! I think, that
application code, which is
independent of any activity, should be placed some neutral place.

Best regards,
Jakob Bjerre Jensen

On 21 Mar., 20:48, hackbod [EMAIL PROTECTED] wrote:
 One approach you can take:

 http://code.google.com/android/reference/android/app/Application.html

 On Mar 21, 12:03 am,JakobBjerreJensen



 [EMAIL PROTECTED] wrote:
  Hello,

  As far as I understand the Android framework, the entry point for an
  application is the
  onCreate() method for some activity. However I would like to do some
  initialization (prior
  to showing the first window in the app), which are related to the whole
  application, not to
  a specific activity.

  Does there exist some hook for doing this? Or is there any other natural
  place to put this kind of
  initialization code?

  Best regards,
 JakobBjerreJensen- Skjul tekst i anførselstegn -

 - Vis tekst i anførselstegn -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread jtaylor

Possibly using sync as well.


- Juan

On Mar 26, 1:42 pm, Peli [EMAIL PROTECTED] wrote:
 Could a ContentObserver be registered for cases like 
 these?http://code.google.com/android/reference/android/database/ContentObse...http://code.google.com/android/reference/android/content/ContentResol...)

 Peli

 On Mar 26, 6:02 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

  ok...Let me tell you what i wanted to doI have a local file that
  has information about all the contacts on the phone. And my
  application uses this local file and not the phone book data
  directly

  So I wanted that, whenever a new contact is added or an old one is
  deleted, I should run a program that would update this local file .
  But this seems to be impossible right now if there's no intent for
  this. I will have to do a check for changes in the phone book and
  update my local file, everytime my application startsThats a bit
  of overhead on my appand will also affect the startup time...

  hackbod wrote:
   No, it has nothing to do with writing a contacts provider.  The
   provider is the back-end data; an activity is the user interface.  You
   just write a new activity that operates on the existing content
   provider.

   On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
If you want to write your own activity implementing those actions, how
would you do that ?
Implementing a new whole ContactsProvider ?
If you only want to replace, say INSERT ?
How your new ContactsProvider can coexist with the standard one if you
want to extend its functionality ?

On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:

 The android.intent.action.INSERT and android.intent.action.VIEW
 actions are not broadcasts, they are actions for starting activities
 to show a UI to insert a new entry, or view an existing entry,
 respectively.  Thus you don't register for them with a receiver, you
 launch them with startActivity().  (You can also write your own
 activity implementing those actions to replace the standard UI, but
 that's probably not what you are wanting.)

 On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

  Thanks Megha...But, will it be provided in the subsequent 
  releases???

  Can you think of a situation where we would need this???

  Dexter.

  On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

   Hi,

   I don't think that the intents for contacts added and contacts 
   deleted
   intents are broadcasted.
   So you cannot receive these intents.

   Thanks,
   Megha

   On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL 
   PROTECTED]
   wrote:

Hello All,

I have an Intent Receiver which I will be triggered when a 
contact is
added or deleted.

My reciever properties in the androidmanifest.xml are as 
follows.

 receiver android:name=.ContactAdded
   intent-filter
   action 
ndroid:name=android.intent.action.INSERT
/
   action 
android:name=android.intent.action.VIEW
/
   /intent-filter
   /receiver

And in my Intent Reciever class, I have the following lines of 
code.

public class ContactAdded {
   public void onReceiveIntent(Context context, Intent 
intent){
   try{
   Log.i(Received Intent, 
intent.getAction());
   }
   catch(Exception e){
   Log.i(Exception in 
Intent,e.getLocalizedMessage
());
   }
   }
}

Now, when I try to add or delete a contact, I can see in the 
LogCat
that the required Intent is broadcast, but I don't see my 
message
Received Intent in the LogCat which I have coded in my 
reciever
class.

Am I doing something wrong???

Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Any Generic Object Pool implementation ?

2008-03-26 Thread Harsh Jain
That ships with android and can be used.

Regards,
harsh

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Graphics performance

2008-03-26 Thread tberthel


My main issues is that the line drawing is usually faster than images
on real phones for up to 12 or so lines, but not the emulator.   The
drawing images and 3d is actually not that bad for fast phones of
2003, but it should be about 8 times faster.  25fps is actually really
fast, but like you said it is just a single test image.

As far as speeding things up the most important thing is to reuse the
Bitmap object and not create one each frame.  I assume you are already
doing that given your getting 25fps.  Not much other than that is
going to dramatically increase performance.  If you follow Google
performance advice document you are doing just about everything you
can do.

Remember the first arcade games that sold millions of copies only got
5-7 fps.

On Mar 26, 11:03 am, David Given [EMAIL PROTECTED] wrote:
 Hello,

 I'm trying to write some highly graphics-intensive code. It's basically
 rendering into a pixel array (int[]), which I want to slam onto the
 screen as quickly as possible.

 What I'm seeing is rather disappointing. What I'm doing is copying the
 pixel array into a Bitmap object using Bitmap.setPixels(), and then
 drawing the Bitmap using a custom View class; the data's actually being
 produced from another thread, so there's also a postInvalidate() in
 there. Full screen, with a dummy drawing routine that just fills the
 array with garbage, this is maxing out at 25fps while using 100% CPU time.

 Does anyone have any suggestions as to what I might be able to do to
 speed things up? For example, is it possible to bypass the compositing
 layer somehow, which has *got* to be hurting things? Is there any way of
 getting the Bitmap's internal pixel store, so I can draw into that and
 save a copy? Any suggestions?

 --
 David Given
 [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

You could use a content observer, but this would require your app
always running to monitor for changes.

I'm not sure of a solution off-hand besides updating your list when
your application starts.  We deliberately decided to not support
having apps launched to be notified when data in a content provider
changes, because that can quickly lead to bogging down the system as
it launches a bunch of apps each time a piece of data changes.

On Mar 26, 10:42 am, Peli [EMAIL PROTECTED] wrote:
 Could a ContentObserver be registered for cases like 
 these?http://code.google.com/android/reference/android/database/ContentObse...http://code.google.com/android/reference/android/content/ContentResol...)

 Peli

 On Mar 26, 6:02 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

  ok...Let me tell you what i wanted to doI have a local file that
  has information about all the contacts on the phone. And my
  application uses this local file and not the phone book data
  directly

  So I wanted that, whenever a new contact is added or an old one is
  deleted, I should run a program that would update this local file .
  But this seems to be impossible right now if there's no intent for
  this. I will have to do a check for changes in the phone book and
  update my local file, everytime my application startsThats a bit
  of overhead on my appand will also affect the startup time...

  hackbod wrote:
   No, it has nothing to do with writing a contacts provider.  The
   provider is the back-end data; an activity is the user interface.  You
   just write a new activity that operates on the existing content
   provider.

   On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
If you want to write your own activity implementing those actions, how
would you do that ?
Implementing a new whole ContactsProvider ?
If you only want to replace, say INSERT ?
How your new ContactsProvider can coexist with the standard one if you
want to extend its functionality ?

On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:

 The android.intent.action.INSERT and android.intent.action.VIEW
 actions are not broadcasts, they are actions for starting activities
 to show a UI to insert a new entry, or view an existing entry,
 respectively.  Thus you don't register for them with a receiver, you
 launch them with startActivity().  (You can also write your own
 activity implementing those actions to replace the standard UI, but
 that's probably not what you are wanting.)

 On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

  Thanks Megha...But, will it be provided in the subsequent 
  releases???

  Can you think of a situation where we would need this???

  Dexter.

  On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

   Hi,

   I don't think that the intents for contacts added and contacts 
   deleted
   intents are broadcasted.
   So you cannot receive these intents.

   Thanks,
   Megha

   On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL 
   PROTECTED]
   wrote:

Hello All,

I have an Intent Receiver which I will be triggered when a 
contact is
added or deleted.

My reciever properties in the androidmanifest.xml are as 
follows.

 receiver android:name=.ContactAdded
   intent-filter
   action 
ndroid:name=android.intent.action.INSERT
/
   action 
android:name=android.intent.action.VIEW
/
   /intent-filter
   /receiver

And in my Intent Reciever class, I have the following lines of 
code.

public class ContactAdded {
   public void onReceiveIntent(Context context, Intent 
intent){
   try{
   Log.i(Received Intent, 
intent.getAction());
   }
   catch(Exception e){
   Log.i(Exception in 
Intent,e.getLocalizedMessage
());
   }
   }
}

Now, when I try to add or delete a contact, I can see in the 
LogCat
that the required Intent is broadcast, but I don't see my 
message
Received Intent in the LogCat which I have coded in my 
reciever
class.

Am I doing something wrong???

Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit 

[android-developers] Re: Coding conventions

2008-03-26 Thread Rui Martins

Some people use m as prefix for all class fields. m stands for
member variable or field.

I don't like this specific convention, and I don't use it, and if I'm
not mistaken, this is not a java recomended convention.

If we really need to make obvious in some specific situation, that
something is a member variable, I use:
   this.variableName

But if this need arises often, there must be something wrong with the
application class architecture, in my opinion.

See ya
   Rui Martins

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to post a new key event?

2008-03-26 Thread Rui Martins

Is your keyboard event handle, onKeyDown(...) method, returning the
correct values when they process a specific key ?
Do you call the super.onKeyDown(...)  and return it's result, when you
don't process a key that you don't recognize ?

Does commenting the onKeyDown(...) method make the EditText Control,
work correctly again ?

Maybe you are just forgetting to call the following on your view:

setFocusable( true ); // Make sure we get keys


NOTE: without Focus you don't receive any keyboard input !



On 26 mar, 18:26, Cheryl Sedota [EMAIL PROTECTED] wrote:
 I am developing an on-screen keyboard activity and need to post a key
 event to Android.  I can't figure out how to do it.

 I've intercepted some key events to see what Android methods are on
 the stack, and it seems that I need to call getParent() from my view
 until I get to the view root (android.view.ViewRoot, which is not an
 accessible class in Android application code) and then call this
 method:

public void dispatchKey(KeyEvent event)

 ... I tried calling that method on my view root object using java
 reflection and passed the key event object that I created.  That call
 was successful but no new text shows up in my EditText control which
 is located within the keyboard activity.

 My first goal is for the EditText control that is located within the
 keyboard activity (which maintains focus even while the key image is
 pressed) to show the text that I have entered using the keyboard.

 My second goal is for an EditText control that is in the Activity
 behind my keyboard activity to show the text that I have entered using
 the keyboard.

 I appreciate any help anyone can provide!!
 Cheryl
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ImageView - Translate Pixels from View to Bitmap

2008-03-26 Thread Rui Martins

You probably have to find out the relative/absolute position of the
view to it's parent(s).
I I'm not mistaken there is a method that returns exactly that. Can't
remember which, check the docs for View.

If you have applyed some sort of transformation (rotate, translate,
etc...) you will need to get the transformation Matrix from the View,
then reverse it, to be able to calc the original position.

On 26 mar, 12:56, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 How can I translate a view x,y pixel to a x,y pixel in the Bitmap?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Graphics performance

2008-03-26 Thread Rui Martins

There is a Static Method (createBitmap(...)) that knows how to build a
Bitmap from a int buffer (32bits per pixel, ARGB), check that out,
maybe it's faster. Haven't check it out against setPixel.

// for M3
Bitmap.createBitmap( colorBuf, w, h, false );

// for M5, you need to replace the false with a Config setting or
someting similar, can't remember exactly.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to post a new key event?

2008-03-26 Thread Cheryl Sedota

Hi, I am not trying to listen for the onKeyDown event in my keyboard
view class or keyboard activity - I want the EditText control that is
in the same viewgroup as my keyboard view to listen for and respond to
it.  Do I have to explicitly set EditText views as focusable?  I
wouldn't think so because I can type on the Android off-screen
keyboard and the text shows up in the EditText view just fine.

On Mar 26, 3:50 pm, Rui Martins [EMAIL PROTECTED] wrote:
 Is your keyboard event handle, onKeyDown(...) method, returning the
 correct values when they process a specific key ?
 Do you call the super.onKeyDown(...)  and return it's result, when you
 don't process a key that you don't recognize ?

 Does commenting the onKeyDown(...) method make the EditText Control,
 work correctly again ?

 Maybe you are just forgetting to call the following on your view:

         setFocusable( true ); // Make sure we get keys

 NOTE: without Focus you don't receive any keyboard input !

 On 26 mar, 18:26, Cheryl Sedota [EMAIL PROTECTED] wrote:



  I am developing an on-screen keyboard activity and need to post a key
  event to Android.  I can't figure out how to do it.

  I've intercepted some key events to see what Android methods are on
  the stack, and it seems that I need to call getParent() from my view
  until I get to the view root (android.view.ViewRoot, which is not an
  accessible class in Android application code) and then call this
  method:

     public void dispatchKey(KeyEvent event)

  ... I tried calling that method on my view root object using java
  reflection and passed the key event object that I created.  That call
  was successful but no new text shows up in my EditText control which
  is located within the keyboard activity.

  My first goal is for the EditText control that is located within the
  keyboard activity (which maintains focus even while the key image is
  pressed) to show the text that I have entered using the keyboard.

  My second goal is for an EditText control that is in the Activity
  behind my keyboard activity to show the text that I have entered using
  the keyboard.

  I appreciate any help anyone can provide!!
  Cheryl- 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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Pass data (bundle) to an activity instance?

2008-03-26 Thread [EMAIL PROTECTED]

Is there an easy way to pass data (a bundle) to an activity instance?


thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Telephony API?

2008-03-26 Thread ajsinclair

Definitely a feature of interest and would be good to see what the
direction is for Android and if it will become a powerful development
platform like Symbian as currently it appears to be a lot more like a
J2ME.

On Mar 27, 4:17 am, GaryH [EMAIL PROTECTED] wrote:
 All:

 I have read a number of post about not being able to intercept
 incoming calls, get the outgoingcallin real time, and a number of
 other phone features which one would expect to be present in an open
 system.

 Without muddling the waters more than they already are around this
 issue, my question is directly aimed at Google. This question and
 request has been asked before, however, I have not seen any direct
 response todate.

 Q: With the platform being toughted as open, why then would you hide
 or otherwise make certain features which many (read as a good
 majority) of the developers seek or need. Certain basic phone features
 are very useful in such a wide variety of applications.

 Aside form perhaps some of the obvious commercial reasons, what are
 the plans to make incercepting incoingcallinformation, outgoingcall
 information and a number of othercallfeatures which other developers
 have inquired about available?

 I think there have been many formal and informal request along this
 line... so whats theanswer?

 Gary
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Pass data (bundle) to an activity instance?

2008-03-26 Thread Dan U.

In your Intent there is a putExtras

On Mar 26, 2:51 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Is there an easy way to pass data (a bundle) to an activity instance?

 thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: loadFromXML causes InvalidPropertiesFormatException

2008-03-26 Thread Dan U.

I wonder if this would have to do with the xml bug where you can't
retreive a NamedNodeMap of all attributes.

On Mar 26, 1:40 pm, Anil [EMAIL PROTECTED] wrote:
 properties.loadFromXML(inputStream);
 throws an InvalidPropertiesFormatException

 I think the file is correct because it works fine in J2SE.

 http://code.google.com/android/reference/java/util/Properties.html

 ?xml version=1.0 encoding=UTF-8?
 properties
 commentconfig file/comment
 entry key=login-idguest/entry
 entry key=remote-servermy.com/entry
 entry key=recording-interval-duration-seconds60/entry
 /properties

 Furthermore, I print out the exception but it only contains the stack
 trace, no message nor clue to the problem.
 Anyone see the same problem?
 thanks,
 Anil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to associate my App with a file extension in the Browser

2008-03-26 Thread Amos

Thanks for your reply, Dianne!

I'll register my Activity like you specified.

But how will I be able to access the downloaded file. Will it be
downloaded to a temp location and have global read permission set on
it? How will the file's path be passed to me using the Intent sent by
the browser?

Many thanks,

Amos

On Mar 26, 7:02 pm, hackbod [EMAIL PROTECTED] wrote:
 All of Android's file mappings are based on MIME types.  As long as
 your web server is returning the correct MIME type, you can implement
 an activity that says it knows how to VIEW that MIME type and it will
 be launched when the user clicks on such a file after downloading it.

 On Mar 26, 3:34 am,Amos[EMAIL PROTECTED] wrote:

  Hi,

  I would like to implement the following scenario:

  When a user browses a web page withBrowserand clicks a link with a
  special file extension (which is unique to my application, such as
  www.mysite.com/somefile.xxx), that file will be downloaded and then
  my application launched to view the downloaded file.

  I'd like thebrowserto handle the file download if possible, and when
  it's done start one of my activities and provide the  file to it.

  This is desktop behavior and I'm not sure it conforms to the Android
  intent/content provider way of doing things - but this is what I'd
  like to happen.

  Any ideas or pointers?

  Thanks in advance,

 Amos
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Pass data (bundle) to an activity instance?

2008-03-26 Thread Charlie Collins

And if you need more than primitive types, and need to pass data only
between apps within in application (not between applications), then
you can extend the Application object, or use a statics, search around
the forum for passing user defined objects.

On Mar 26, 6:28 pm, Dan U. [EMAIL PROTECTED] wrote:
 In your Intent there is a putExtras

 On Mar 26, 2:51 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Is there an easy way to pass data (a bundle) to an activity instance?

  thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Problems with getCurrentLocation(gps)

2008-03-26 Thread Markus

Hello out there,
I'm trying to develop an android application which uses GPS for that I
implemented following way to get my location:
m_locationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location location = m_locationManager.getCurrentLocation(gps);
But everytime the variable location is null. In the manifest I've
added the permissions
uses-permission

android:name=android.Manifest.permission.ACCESS_LOCATION/
uses-permission
android:name=android.Manifest.permission.ACCESS_GPS/
With the tool DDMS I've added the file kml at the directory /data/misc/
location/gps.
When I'm calling the method getProviderStatus(gps) I'm getting the
status 0 which meand that the Service is not availible. I've got no
idea why. Can anybody helpt me?

thanks

Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: help- 670 errors :( R cannot be resolved

2008-03-26 Thread Charlie Collins

R.java is generated using the aapt tool.  If the Eclipse plugin is
giving you problems generating this automatically (likely because you
have something corrupted or misconfigured), then try doing it manually
on the command line.

http://code.google.com/android/reference/aapt.html

On Mar 26, 12:55 pm, hm [EMAIL PROTECTED] wrote:
 thnx dan for your reply

 I have done several times creating a new projects in eclipse through
 linking the Api Demo in the sample
 but every time im sawing this error.
 :((
 what would i do now
 R.java is an autogenerated file

 could i make it myself??
 could you share your R.java of the Api demo sample here so that i can
 copy paste that
 would this approach will work

 On Mar 26, 10:47 pm, Dan U. [EMAIL PROTECTED] wrote:

  It sounds like something is corrupted. I'd recommend creating a new
  project and moving everything over to that one.

  On Mar 26, 9:27 am, hm [EMAIL PROTECTED] wrote:

   yes offcourse

   On Mar 26, 10:13 pm, Dan U. [EMAIL PROTECTED] wrote:

Was your project created as an Android project?

On Mar 26, 7:58 am, hm [EMAIL PROTECTED] wrote:

 hi
 im a late comer in adc.

 im getting a problem while running the api demo in the sample
 it is generating 670 errors 69 warnings

 the main error is R cannot be resolved.
 im not able to find the R.java while creating the project from the
 given source.
 im using Eclipse 3.3.1 M5 Windows.

 i create some sample other apps but did not face any error like this.
 i tried to fixed it from the Android ToolsFixed Projects Properties.
 but it didnt fixed

 best regards
 hm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problems with getCurrentLocation(gps)

2008-03-26 Thread Dan U.

The name of the permissions is wrong. Try this:

uses-permission
android:name=android.permission.ACCESS_LOCATION /
uses-permission android:name=android.permission.ACCESS_GPS /

On Mar 26, 4:26 pm, Markus [EMAIL PROTECTED] wrote:
 Hello out there,
 I'm trying to develop an android application which uses GPS for that I
 implemented following way to get my location:
 m_locationManager =
 (LocationManager)getSystemService(Context.LOCATION_SERVICE);
 Location location = m_locationManager.getCurrentLocation(gps);
 But everytime the variable location is null. In the manifest I've
 added the permissions
 uses-permission
 
 android:name=android.Manifest.permission.ACCESS_LOCATION/
 uses-permission
 android:name=android.Manifest.permission.ACCESS_GPS/
 With the tool DDMS I've added the file kml at the directory /data/misc/
 location/gps.
 When I'm calling the method getProviderStatus(gps) I'm getting the
 status 0 which meand that the Service is not availible. I've got no
 idea why. Can anybody helpt me?

 thanks

 Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Canvas.drawArc

2008-03-26 Thread Kenny

Hi,

Has anyone successfully use the drawArc function?  or is that part of
the SDK not ready yet?

Kenny
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: PackageManager.installPackage() ?

2008-03-26 Thread Ben Dodson

Extremely unlikely is better than no chance at all :) I posted a
request here if anyone's interested:
http://code.google.com/p/android/issues/detail?id=545

thanks for the help Diane.


Ben

On Mar 25, 12:31 pm, hackbod [EMAIL PROTECTED] wrote:
 On Mar 25, 5:58 am, Ben Dodson [EMAIL PROTECTED] wrote:

  if I'm correct, activities can only exist when defined by a top-level
  application, which must be installed through the package manager.

 Correct.

  If that's the case, would it be worthwhile to file a feature request?

 You can, but it is extremely unlikely this is something we'd have time
 to address for 1.0.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to associate my App with a file extension in the Browser

2008-03-26 Thread Jean-Baptiste Queru

Hello, I'm the Google engineer who works on that area of Android.

Indeed, the download system is still under development, and you can expect
to see changes there at some point.

The two key aspects that you need to know is that:
-the MIME type is what matters. The URI extension is not relevant in this case.
-in order for the files to be downloaded and for your app to be launched, your
application needs to register as a viewer the MIME type of your files
(Intent.VIEW_ACTION).

There's a high probability that in the long run the files downloaded from the
browser will be saved on the SD card (which the emulator can emulate).
However, I am not sure what the exact behavior is in the currently available
SDKs.

(For what it's worth, at the implementation level, there's indeed going to be
some code that involves some content providers and some permissions, but
at your level you don't need to worry about that, that's only used by the
browser to manage its downloads).

JBQ

On Wed, Mar 26, 2008 at 5:52 PM, hackbod [EMAIL PROTECTED] wrote:

  This stuff is still under development, but I believe right now it is
  downloaded into a content provider that anyone can access.  In the
  future, this will be downloaded to a more sophisticated download
  manager, that maintains per-item permissions so only the application
  requesting a download can access the files it is downloading, and it
  can then allow other applications to access particular uris -- such as
  when the user clicks on one of the downloads, granting the launched
  activity permission to open that particular uri.



  On Mar 26, 3:29 pm, Amos [EMAIL PROTECTED] wrote:
   Thanks for your reply, Dianne!
  
   I'll register my Activity like you specified.
  
   But how will I be able to access the downloaded file. Will it be
   downloaded to a temp location and have global read permission set on
   it? How will the file's path be passed to me using the Intent sent by
   the browser?
  
   Many thanks,
  
   Amos
  
   On Mar 26, 7:02 pm, hackbod [EMAIL PROTECTED] wrote:
  
All of Android's file mappings are based on MIME types.  As long as
your web server is returning the correct MIME type, you can implement
an activity that says it knows how to VIEW that MIME type and it will
be launched when the user clicks on such a file after downloading it.
  
On Mar 26, 3:34 am,Amos[EMAIL PROTECTED] wrote:
  
 Hi,
  
 I would like to implement the following scenario:
  
 When a user browses a web page withBrowserand clicks a link with a
 special file extension (which is unique to my application, such as
 www.mysite.com/somefile.xxx), that file will be downloaded and then
 my application launched to view the downloaded file.
  
 I'd like thebrowserto handle the file download if possible, and when
 it's done start one of my activities and provide the  file to it.
  
 This is desktop behavior and I'm not sure it conforms to the Android
 intent/content provider way of doing things - but this is what I'd
 like to happen.
  
 Any ideas or pointers?
  
 Thanks in advance,
  
Amos
  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

What do you mean by sync???

On Mar 27, 12:12 am, jtaylor [EMAIL PROTECTED] wrote:
 Possibly using sync as well.

 - Juan

 On Mar 26, 1:42 pm, Peli [EMAIL PROTECTED] wrote:

  Could a ContentObserver be registered for cases like 
  these?http://code.google.com/android/reference/android/database/ContentObse..)

  Peli

  On Mar 26, 6:02 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

   ok...Let me tell you what i wanted to doI have a local file that
   has information about all the contacts on the phone. And my
   application uses this local file and not the phone book data
   directly

   So I wanted that, whenever a new contact is added or an old one is
   deleted, I should run a program that would update this local file .
   But this seems to be impossible right now if there's no intent for
   this. I will have to do a check for changes in the phone book and
   update my local file, everytime my application startsThats a bit
   of overhead on my appand will also affect the startup time...

   hackbod wrote:
No, it has nothing to do with writing a contacts provider.  The
provider is the back-end data; an activity is the user interface.  You
just write a new activity that operates on the existing content
provider.

On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
 If you want to write your own activity implementing those actions, how
 would you do that ?
 Implementing a new whole ContactsProvider ?
 If you only want to replace, say INSERT ?
 How your new ContactsProvider can coexist with the standard one if you
 want to extend its functionality ?

 On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:

  The android.intent.action.INSERT and android.intent.action.VIEW
  actions are not broadcasts, they are actions for starting activities
  to show a UI to insert a new entry, or view an existing entry,
  respectively.  Thus you don't register for them with a receiver, 
  you
  launch them with startActivity().  (You can also write your own
  activity implementing those actions to replace the standard UI, but
  that's probably not what you are wanting.)

  On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

   Thanks Megha...But, will it be provided in the subsequent 
   releases???

   Can you think of a situation where we would need this???

   Dexter.

   On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

Hi,

I don't think that the intents for contacts added and contacts 
deleted
intents are broadcasted.
So you cannot receive these intents.

Thanks,
Megha

On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL 
PROTECTED]
wrote:

 Hello All,

 I have an Intent Receiver which I will be triggered when a 
 contact is
 added or deleted.

 My reciever properties in the androidmanifest.xml are as 
 follows.

  receiver android:name=.ContactAdded
intent-filter
action 
 ndroid:name=android.intent.action.INSERT
 /
action 
 android:name=android.intent.action.VIEW
 /
/intent-filter
/receiver

 And in my Intent Reciever class, I have the following lines 
 of code.

 public class ContactAdded {
public void onReceiveIntent(Context context, Intent 
 intent){
try{
Log.i(Received Intent, 
 intent.getAction());
}
catch(Exception e){
Log.i(Exception in 
 Intent,e.getLocalizedMessage
 ());
}
}
 }

 Now, when I try to add or delete a contact, I can see in the 
 LogCat
 that the required Intent is broadcast, but I don't see my 
 message
 Received Intent in the LogCat which I have coded in my 
 reciever
 class.

 Am I doing something wrong???

 Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: loadFromXML causes InvalidPropertiesFormatException

2008-03-26 Thread Anil

frustrating when it appears to be a basic android bug, and also that
no one from google has replied.

On Mar 26, 5:30 pm, Dan U. [EMAIL PROTECTED] wrote:
 I wonder if this would have to do with the xml bug where you can't
 retreive a NamedNodeMap of all attributes.

 On Mar 26, 1:40 pm, Anil [EMAIL PROTECTED] wrote:

  properties.loadFromXML(inputStream);
  throws an InvalidPropertiesFormatException

  I think the file is correct because it works fine in J2SE.

 http://code.google.com/android/reference/java/util/Properties.html

  ?xml version=1.0 encoding=UTF-8?
  properties
  commentconfig file/comment
  entry key=login-idguest/entry
  entry key=remote-servermy.com/entry
  entry key=recording-interval-duration-seconds60/entry
  /properties

  Furthermore, I print out the exception but it only contains the stack
  trace, no message nor clue to the problem.
  Anyone see the same problem?
  thanks,
  Anil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Life cycle of activities updating a database

2008-03-26 Thread tenacious

I've encountered this paradigm too and would also like to know why
results can't be set as late as onPause?  Hopefully somebody
knowledgeable can chime in...

Having the differing behaviors between confirm and onPause() is
causing pain because I want to have the cancel button act like
confirm (the user is always saving unless explicitly clearing all
fields or clicking a cancel/delete button)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Peli

Great that you liked the idea.

In fact, this would be useful for more than one application, so one
small background service could actually keep track of changes for
several applications. In this general sense, it would eventually be
interesting for our project as well (OpenIntents - 
http://code.google.com/p/openintents/
).

Some caveats:
* Whenever your service crashes or is stopped by the system or
whenever the phone is rebooted, you probably can not be sure that no
fields have changed in the mean-time, so then a full scan is necessary
anyway.
* Is it possible to get a hash of the whole database file, like an
md5? Would the system allow this? Then one would only have to rescan
the database if the hash changed while the service was off.

Peli


On Mar 27, 4:16 am, Dexter's Brain [EMAIL PROTECTED] wrote:
 Ok...this seems to be the only option to me now..I LL DO
 THAT.:-)

 On Mar 27, 5:20 am, Peli [EMAIL PROTECTED] wrote:



   You could use a content observer, but this would require your app
   always running to monitor for changes.

  So one could probably write a lightweight background service that uses
  a content observer to constantly monitor for changes, and notifies the
  starting app only of those fields that have changed in the meantime.

  Of course this effort would only make sense if the contact list is
  long, and the app is used frequently...

  Peli

   I'm not sure of a solution off-hand besides updating your list when
   your application starts.  We deliberately decided to not support
   having apps launched to be notified when data in a content provider
   changes, because that can quickly lead to bogging down the system as
   it launches a bunch of apps each time a piece of data changes.

   On Mar 26, 10:42 am, Peli [EMAIL PROTECTED] wrote:

Could a ContentObserver be registered for cases like 
these?http://code.google.com/android/reference/android/database/ContentObse..)

Peli

On Mar 26, 6:02 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

 ok...Let me tell you what i wanted to doI have a local file that
 has information about all the contacts on the phone. And my
 application uses this local file and not the phone book data
 directly

 So I wanted that, whenever a new contact is added or an old one is
 deleted, I should run a program that would update this local file .
 But this seems to be impossible right now if there's no intent for
 this. I will have to do a check for changes in the phone book and
 update my local file, everytime my application startsThats a bit
 of overhead on my appand will also affect the startup time...

 hackbod wrote:
  No, it has nothing to do with writing a contacts provider.  The
  provider is the back-end data; an activity is the user interface.  
  You
  just write a new activity that operates on the existing content
  provider.

  On Mar 26, 3:24 am, Diego Torres Milano [EMAIL PROTECTED] wrote:
   If you want to write your own activity implementing those 
   actions, how
   would you do that ?
   Implementing a new whole ContactsProvider ?
   If you only want to replace, say INSERT ?
   How your new ContactsProvider can coexist with the standard one 
   if you
   want to extend its functionality ?

   On Mar 26, 7:35 am, hackbod [EMAIL PROTECTED] wrote:

The android.intent.action.INSERT and android.intent.action.VIEW
actions are not broadcasts, they are actions for starting 
activities
to show a UI to insert a new entry, or view an existing entry,
respectively.  Thus you don't register for them with a 
receiver, you
launch them with startActivity().  (You can also write your own
activity implementing those actions to replace the standard UI, 
but
that's probably not what you are wanting.)

On Mar 25, 8:35 pm, Dexter's Brain [EMAIL PROTECTED] wrote:

 Thanks Megha...But, will it be provided in the subsequent 
 releases???

 Can you think of a situation where we would need this???

 Dexter.

 On Mar 26, 3:15 am, Megha Joshi [EMAIL PROTECTED] wrote:

  Hi,

  I don't think that the intents for contacts added and 
  contacts deleted
  intents are broadcasted.
  So you cannot receive these intents.

  Thanks,
  Megha

  On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain [EMAIL 
  PROTECTED]
  wrote:

   Hello All,

   I have an Intent Receiver which I will be triggered when 
   a contact is
   added or deleted.

   My reciever properties in the androidmanifest.xml are as 
   follows.

            receiver android:name=.ContactAdded
                  intent-filter
                          action 
   

[android-developers] Who is responsible for closing FilterableListAdapters on AutoCompleteTextView

2008-03-26 Thread Rainer

Hey
I have a form with an AutoCompleteTextView which is backed by a
SimpleCursorAdapter. My problem is that it seems that nobody closes
the Cursors returned by runQuery(). I dont think that I as a user of
SimpleCursorAdapter am responsible for closing them as there does not
seem to be an obvious place to do that. Also the decompliation report
(ups, should I say that?) of CursorAdapter seems to indicate that
these cursors are simply lost and never closed. The effect is that
after using the query feature a couple of times and dismissing the
Form (I guess this is then when the garbage collector starts cleaning
up) I get an IllegalStateException warning me that the cursor has not
been closed.

The documentation of SimpleCursorAdapter.runQuery does not mention
that the cursor must be remembered and closed. Also even if I tried
that, I dont find an obvious place (event) at which point it would be
safe to close the cursors (I would need to subclass
SimpleCursorAdapter or provide a FilterQueryProvider which would then
remember all Cursors that have been handed out and only then clean
them up at an appropriate time.

I honestly think this is a bug.

Any suggestions? I am so close to submitting my dev challenge project.
Argh.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

I totally agree.To detect even a single change, I will surely have
to rescan everythingThats a lot of work of course

Dexter.

On Mar 27, 9:30 am, severian [EMAIL PROTECTED] wrote:
 The problem is that ContentObserver.onChange() doesn't tell you what
 changed. So how do you figure it out? Well, as far as I can tell you
 have to keep your own copy of everything you might care about in the
 database, and then when you get onChange() you read everything from
 the ContentProvider and then compare it to your local copy, looking
 for changes. That is, you have to rescan the database with every
 change, not just between instantiations. But if I'm wrong, please tell
 me!

 Since you (DB) are storing a local copy anyway, this might be
 feasible, but for most purposes this is just too onerous to be useful.

 I really hope they fix this API to indicate what has changed, because
 ContentObserver is a nice idea - it allows different frontend and
 backend applications to share a common data pool.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] SMS

2008-03-26 Thread baskar

Hi All,

How to use SMS Reading and SMS Listening in Android..
please help me...

Regards,
Baskar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Share XML files

2008-03-26 Thread CaptainFanatic

I want to share data between two android phones, preferably by sending
XML files, and I'm hoping for some feedback on what is the best way to
do this. The reason I want to use XML is to keep things loosely
coupled - this data could then be shared with apps on other platforms
etc.

One method I'm considering is (assuming there will be a standard
bluetooth application for sharing files) to dump data from the SQL
backend of my application into an XML file, that can then be sent in
the same manner as any other file over bluetooth to another phone. I
see that android has methods to write to a file, but where will this
file live and will I be able to access it from a bluetooth app to then
send it?

I look forward to hearing 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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

On Mar 26, 9:30 pm, severian [EMAIL PROTECTED] wrote:
 I really hope they fix this API to indicate what has changed, because
 ContentObserver is a nice idea - it allows different frontend and
 backend applications to share a common data pool.

It's a very intentional design.  In fact originally the API did tell
you what changed, but in many cases it is difficult if not near
impossible to provide that information.  The API is primarily designed
for user interface elements like list views, and it turns out that it
is really at least as easy for them to re-query the cursor and
synchronize its new contents with the list, than to try to keep track
of each change that happens and apply that to its representation of
what is in the cursor (and hope that actually stays consistent with
what is in the content provider).

At any rate, it is far far safer to re-synchronize with the current
contents of the content provider, than to try to integrate step-wise
updates and try to actually guarantee that your view of what is in the
provider actually matches its real contents.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---