[android-developers] Re: help me Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE

2009-11-09 Thread Ola
If you want to use android:sharedUserId=android.uid.system you have
to sign your apk file with the platform certificate, i.e. the
certificate your phone's software was built with.

//O

On Nov 6, 10:51 am, hehui he...@yulong.com wrote:
 when  I    add        android:sharedUserId=android.uid.system  to
 the  AndroidManifest.xml file   the  project  can not  be  installed
 on  G2  . the  error  is                   Installation error:
 INSTALL_FAILED_UPDATE_INCOMPATIBLE                 who  can  help
 me  ?  Thanks in  advance  !

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


[android-developers] Re: invoking the dialer multiple time

2009-07-29 Thread Ola


 So my question is: does anyone know how I could programmatically exit
 the call log activity as ways to be able to submit another ACTION_CALL
 intent ?

I am also interested in this same thing. I would like to
programmatically exit the DialtactsActivity from my service and return
to the home screen.

BR,
//Ola

On Jul 26, 3:45 pm, flohier floh...@gmail.com wrote:
 Dear All,

 I wrote an app that places an outgoing call via the ACTION_CALL
 intent.

 After the call is placed, the dialer enters the call log window and at
 that point, my application cannot re-submit an outgoing call without
 having the user exit the call log activity.

 From the kernel source, InCallScreen.java shows implements the
 delayedCleanupAfterDisconnect() method where one can read:

        .

                 // If this is a call that was initiated by the user,
 and
                 // we're *not* in emergency mode, finish the call by
                 // taking the user to the Call Log.
                 // Otherwise we simply call finish(), which will take
 us
                 // back to wherever we came from.
                 if (mShowCallLogAfterDisconnect  !
 isPhoneStateRestricted()) {
                     if (VDBG) log(- Show Call Log after
 disconnect...);
                     final Intent intent = PhoneApp.createCallLogIntent
 ();
                     startActivity(intent);
                     // Even in this case we still call finish()
 (below),
                     // to make sure we don't stay in the activity
 history.
                 }

                 finish();

 The mShowCallLogAfterDisconnect is a boolean also in InCallScreen.java
 that reads:

     // Flag indicating whether or not we should bring up the Call Log
 when
     // exiting the in-call UI due to the Phone becoming idle.  (This
 is
     // true if the most recently disconnected Call was initiated by
 the
     // user, or false if it was an incoming call.)
     // This flag is used by delayedCleanupAfterDisconnect(), and is
 set by
     // onDisconnect() (which is the only place that either posts a
     // DELAYED_CLEANUP_AFTER_DISCONNECT event *or* calls
     // delayedCleanupAfterDisconnect() directly.)
     private boolean mShowCallLogAfterDisconnect;

 If I trust the comment properly, the dialer will enter the call log
 activity unless we had an incoming call triggering InCallScreen. I
 presume that by call was initiaited by the user also means other
 activity invoking ACTION_CALL.

 So my question is: does anyone know how I could programmatically exit
 the call log activity as ways to be able to submit another ACTION_CALL
 intent ?

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



[android-developers] Re: getView from CustomizedAdapter called several times

2009-07-23 Thread Ola Ingvaldsen
I am having the same problem. In my case it only happens if I specify my own
layout using setContentView in onCreate() of my ListActivity. If i use the
standard layout i get correct number of calls to getView.

The thing is that if I have 5 items in my list i suspect the first 5 calls
to getView to have convertView=null each time. But its not. First time its
null, then the next 5 calls have the same convertView as the previous call
and then 5 more calls where the convertView is null.  So the first 6 calls
to getView only results in changing the first element 5 times more than
whats necessary.  After the 5 first calls the convertView is null and the
rest of the items in the list are filled out correctly. But when i scroll
down the list, we have 10 more calls again.

Does anybody have an idea whats wrong? Or how it can be avoided?

I have no weights in my layout at all. Its just a simple textView with a
status message and a listView.

-Ola

On Wed, Jul 15, 2009 at 4:05 PM, Streets Of Boston
flyingdutc...@gmail.comwrote:


 I'm not a google engineer, so i don't know the answer, but i have a
 theory why this may happen.

 In your layouts, do you use 'weights' (weightsum and layoutweight)?
 If i remember correctly, if you use these attributes, layout-code is
 called twice.
 If the layout-code for a list-view includes the 'getView' then this
 would explain it being called 4 times for 2 child views.

 On Jul 15, 2:40 am, Mika mika.ristim...@tkk.fi wrote:
  Hi,
 
  I'm having the same problem. Did you find any solutions??
 
  -Mika
 
  On Jun 24, 7:39 pm, jabu jabu.j...@gmail.com wrote:
 
 
 
   Hi Everyone,
 
   I am implementing my ownadapterthat inherits from BaseAdapter (this
   is something very classic).
   Then when I start the activity that owns the listView binded to
 thisadapterI can see that the getView() method is called moretimesthan
   what the number of view actually available in the list.
   For instance, I do have 2 rows in my list and when I first set
 theadaptergetView is called 6times. Then If I make a call to
   notifyDataSetChanged(), getView is called 4times.
   I understand that when you scroll up and down getView must be called
   to generate or re use a view but I don't scroll up or down, I am
   really wondering why getView is called so many time.
 
   Thanks a lot in advance for your responses.
   Jabu
 
   My code just in case even though it is a pretty basic piece of code:
 
   public View getView(int position, View convertView, ViewGroup
   parent)
   {
   ViewHolder holder;
   if (convertView == null)
   {
   convertView =
 mInflater.inflate(R.layout.row_action, null);
   // Creates a view holder
   holder = new ViewHolder();
   ...
   convertView.setTag(holder);
   }
   else
   {
   holder = (ViewHolder)convertView.getTag();
   }
   holder.params.set
   return convertView;
}- Hide quoted text -
 
  - Show quoted text -
 


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



[android-developers] Re: peekService only returning null IBinder

2009-07-17 Thread Ola

Thanks for your help. Using startService my program works as expected!

//Ola

On Jul 17, 12:10 am, Dianne Hackborn hack...@android.com wrote:
 A broadcast receiver can certainly use startService().  That is the standard
 way for them to do some longer-running operation.



 On Thu, Jul 16, 2009 at 3:06 PM, Ola stens...@gmail.com wrote:

  I see, but I understand that already. The problem is that the service
  itself is already started, and a BroadcastReceiver cannot perform
  bindService or startService. The only way of communicating between a
  BroadcastReceiver and a Service is using peekService. Or can I perhaps
  embed a BroadcastReceiver inside my Service in any way?

  Cheers,
  Ola

  On 16 Juli, 20:44, Dianne Hackborn hack...@android.com wrote:
   Actually let me put this another way -- if you want guarantees about your
   communication happening with the service, you absolutely do not want
   peekService().  You should use startService() and send it a command.
   Where
   peekService() makes sense is for background music playback, where if it
   fails it is because playback is not happening and we don't care.

   On Thu, Jul 16, 2009 at 11:43 AM, Dianne Hackborn hack...@android.com
  wrote:

Calling startService() is not enough -- you need to have called
bindService() for the same intent, so the system had retrieved the
  IBinder
for it.  It needs to have been kept running.  This is useful for
  something
like background media playback, which has a published interface whiloe
  it is
running (and is in fact what it was added for), but perhaps little
  else. :}

On Thu, Jul 16, 2009 at 6:29 AM, Ola stens...@gmail.com wrote:

I'm having a problem using peekService(Context, Intent) from my
BroadcastReceiver to notify a Service of an event.

I have written a little application that sends an SMS and verifies
that it is sent. It is run as a Service, not an Activity, in order to
send text messages from the background. I have a BroadcastReceiver
that listens to the Sms sent successfully and Sms delivered
successfully intents that are broadcast when the message is sent and
delivered.

The messages are sent successfully and the BroadcastReceiver is then
triggered and it prints into the log when the message is sent and when
it is delivered. I however want the BroadcastReceiver to tell the
Service that the message is sent successfully, so the service knows if
it was successful. This is where the peekService method seems to be
suitable. I'm calling it from the BroadcastReceiver's onReceive
method, but peekService only returns a null IBinder, which obviously
is of no use to me.

The Service is still running and has not been destroyed. It is
sleeping for 15 seconds at 1-second intervals and printing that into
the log, waiting for the BroadcastReceiver to notify it of a sent
message.

The Intent I use in peekService is _identical_ to the one I used when
calling startService in the first place, so the intent should be
correct, since starting the Service worked.

There is sadly no useful log to paste here, all it does is prints that
my IBinder is null, a NullPointerException.

Cheers,
Ola

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

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

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

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

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] peekService only returning null IBinder

2009-07-16 Thread Ola

I'm having a problem using peekService(Context, Intent) from my
BroadcastReceiver to notify a Service of an event.

I have written a little application that sends an SMS and verifies
that it is sent. It is run as a Service, not an Activity, in order to
send text messages from the background. I have a BroadcastReceiver
that listens to the Sms sent successfully and Sms delivered
successfully intents that are broadcast when the message is sent and
delivered.

The messages are sent successfully and the BroadcastReceiver is then
triggered and it prints into the log when the message is sent and when
it is delivered. I however want the BroadcastReceiver to tell the
Service that the message is sent successfully, so the service knows if
it was successful. This is where the peekService method seems to be
suitable. I'm calling it from the BroadcastReceiver's onReceive
method, but peekService only returns a null IBinder, which obviously
is of no use to me.

The Service is still running and has not been destroyed. It is
sleeping for 15 seconds at 1-second intervals and printing that into
the log, waiting for the BroadcastReceiver to notify it of a sent
message.

The Intent I use in peekService is _identical_ to the one I used when
calling startService in the first place, so the intent should be
correct, since starting the Service worked.

There is sadly no useful log to paste here, all it does is prints that
my IBinder is null, a NullPointerException.

Cheers,
Ola

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



[android-developers] peekService only returning null IBinder

2009-07-16 Thread Ola

I'm having a problem using peekService(Context, Intent) from my
BroadcastReceiver to notify a Service of an event.

I have written a little application that sends an SMS and verifies
that it is sent. It is run as a Service, not an Activity, in order to
send text messages from the background. I have a BroadcastReceiver
that listens to the Sms sent successfully and Sms delivered
successfully intents that are broadcast when the message is sent and
delivered.

The messages are sent successfully and the BroadcastReceiver is then
triggered and it prints into the log when the message is sent and when
it is delivered. I however want the BroadcastReceiver to tell the
Service that the message is sent successfully, so the service knows if
it was successful. This is where the peekService method seems to be
suitable. I'm calling it from the BroadcastReceiver's onReceive
method, but peekService only returns a null IBinder, which obviously
is of no use to me.

The Service is still running and has not been destroyed. It is
sleeping for 15 seconds at 1-second intervals and printing that into
the log, waiting for the BroadcastReceiver to notify it of a sent
message.

The Intent I use in peekService is _identical_ to the one I used when
calling startService in the first place, so the intent should be
correct, since starting the Service worked.

There is sadly no useful log to paste here, all it does is prints that
my IBinder is null, a NullPointerException.

Some code (called from within BroadcastReceiver.onReceive:


Intent serviceIntent = new Intent();
serviceIntent.setComponent(new ComponentName(mypackages.services,
mypackages.services.Messages));
binder = peekService(context,serviceIntent);

if (binder == null) Log.d(TAG, binder == null);
else Log.d(TAG, binder != null);


The log at the end shows binder == null.

Cheers,
Ola

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



[android-developers] Re: peekService only returning null IBinder

2009-07-16 Thread Ola

I see, but I understand that already. The problem is that the service
itself is already started, and a BroadcastReceiver cannot perform
bindService or startService. The only way of communicating between a
BroadcastReceiver and a Service is using peekService. Or can I perhaps
embed a BroadcastReceiver inside my Service in any way?

Cheers,
Ola

On 16 Juli, 20:44, Dianne Hackborn hack...@android.com wrote:
 Actually let me put this another way -- if you want guarantees about your
 communication happening with the service, you absolutely do not want
 peekService().  You should use startService() and send it a command.  Where
 peekService() makes sense is for background music playback, where if it
 fails it is because playback is not happening and we don't care.

 On Thu, Jul 16, 2009 at 11:43 AM, Dianne Hackborn hack...@android.comwrote:





  Calling startService() is not enough -- you need to have called
  bindService() for the same intent, so the system had retrieved the IBinder
  for it.  It needs to have been kept running.  This is useful for something
  like background media playback, which has a published interface whiloe it is
  running (and is in fact what it was added for), but perhaps little else. :}

  On Thu, Jul 16, 2009 at 6:29 AM, Ola stens...@gmail.com wrote:

  I'm having a problem using peekService(Context, Intent) from my
  BroadcastReceiver to notify a Service of an event.

  I have written a little application that sends an SMS and verifies
  that it is sent. It is run as a Service, not an Activity, in order to
  send text messages from the background. I have a BroadcastReceiver
  that listens to the Sms sent successfully and Sms delivered
  successfully intents that are broadcast when the message is sent and
  delivered.

  The messages are sent successfully and the BroadcastReceiver is then
  triggered and it prints into the log when the message is sent and when
  it is delivered. I however want the BroadcastReceiver to tell the
  Service that the message is sent successfully, so the service knows if
  it was successful. This is where the peekService method seems to be
  suitable. I'm calling it from the BroadcastReceiver's onReceive
  method, but peekService only returns a null IBinder, which obviously
  is of no use to me.

  The Service is still running and has not been destroyed. It is
  sleeping for 15 seconds at 1-second intervals and printing that into
  the log, waiting for the BroadcastReceiver to notify it of a sent
  message.

  The Intent I use in peekService is _identical_ to the one I used when
  calling startService in the first place, so the intent should be
  correct, since starting the Service worked.

  There is sadly no useful log to paste here, all it does is prints that
  my IBinder is null, a NullPointerException.

  Cheers,
  Ola

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

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

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to add a new ContentProvider to Contacts

2009-06-29 Thread Ola

Hi

I want to add an extra field to the phonebook on android. The field
contains a new contact method and when clicked it should start my own
application/intent.  I have created my own content provider that
stores the  information. I want to add this contentProvider to the
phonebook in the same way organizations and email are added to the
phone book. So how do i do this? I tried adding a new contact method
but the field KIND needs an integer input which seems to be predefined
to some specific methods (EMAIL, IM, ADDRESS etc)

So do i need to add a new type of KIND or can I link my
contentProvider to the phone book so that it shows up as an extra
field in the phone book?

Regards
Ola

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