Re: [android-developers] outOfMemoryError

2011-03-29 Thread sukumar bhashyam
Try recycling the unused bitmap. Not sure why do you need to store the all
bitmaps in ArrayList.

There could be a memory leak. Analyse the memory usage of your application.
Check here for more info (
http://android-developers.blogspot.com/2011/03/memory-analysis-for-android.html)
.



On Tue, Mar 29, 2011 at 6:07 PM, vani reddy vani.redd...@gmail.com wrote:

 I am getting the outOfMemoryError,bitmap size exceeds the virtual machine
 budget

 i am doing the below


 public void getBitmap1(String str)
  {
  InputStream is =null;
  try {
  URL myFileUrl =new URL(str);
  HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
 conn.setDoInput(true);
  conn.connect();
  is = conn.getInputStream();
 Bitmap orgImg = BitmapFactory.decodeStream(is);//this  line it is throwing
 exception
  barcode_bitmap.add(orgImg);//   barcode_bitmap is an arraylist of bitmap.
   } catch (IOException e) {
 e.printStackTrace();
  }
  finally{
 if(is!=null)
 {
  try {
 is.close();
 } catch (IOException e) {
  // TODO Auto-generated catch block
 e.printStackTrace();
 }
  }
 }
  }

 How to resolve this, it comes once in a while.
 Please help,Thanks in advance:-)

 --
  Regards,
 Vani Reddy

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

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

Re: [android-developers] Re: Mms-Sms database Thread Id Issue

2011-02-17 Thread sukumar bhashyam
Ya...Just noticied that MmsSmsProvider didn't have a direct uri for
canonical_addresses. But they have it for canonical_addresses item (
canonical-address/# ).

I suggest you to first query Thread's table to get all recipients_id and
then look into canonical_addresses item for the address. You might ends up
in making mutiple queries to canonical_addresses item uri.

On Thu, Feb 17, 2011 at 4:11 PM, Madhavi madhavi.har...@gmail.com wrote:

 Thanks for the early reply.
 The idea is good to check first in canonical_addresses table but i
 have not found Uri exposed to get canonical table _id for the given
 address.
 We have the only Uri exposed to fetch address for the given _id. Do
 you have any idea how to get _id from canonical_addresses table for
 the given address.
 Following is the refered link for uris

 http://www.netmite.com/android/mydroid/packages/providers/TelephonyProvider/src/com/android/providers/telephony/MmsSmsProvider.java

 Thanks,
 Madhavi

 On Feb 16, 6:54 pm, sukumar bhashyam bhashyam.suku...@gmail.com
 wrote:
  hi ,
 
  Uri content://mms-sms doesn't point to any table in mmssms db, Its just
 a
  base uri.
 
  To check for address, I guess, you need to run below steps...
 
   -- First query canonical_addresses table and get the _id, If query
 has 0
  count then address is not found.
   -- If not, then look for _id in threads table ( Threads.ContentUri)
 where
  recipients_id is equal to id received in step 1.
 
 
 
  On Wed, Feb 16, 2011 at 5:22 PM, Madhavi madhavi.har...@gmail.com
 wrote:
   Hi All,
 
   In my application I have tried to get thread id using following code.
 
   public static long getThreadIdFromAddress(ContentResolver resolver,
  String address)
  {
  if (address == null)
  {
  return 0;
  }
  // Content URIs for SMS app, these may change in future
 SDK
  Uri threadIdContentUri = Uri.withAppendedPath(Uri
  .parse(content://mms-sms/),
 threadID);
  String smsId = _id;
  String threadRecipientQuery = recipient;
  Uri.Builder uriBuilder = threadIdContentUri.buildUpon();
  uriBuilder.appendQueryParameter(threadRecipientQuery,
   address);
  long threadId = 0;
  Cursor cursor = resolver.query(uriBuilder.build(),
  new String[] { smsId }, null, null,
 null);
  if (cursor != null)
  {
  try
  {
  if (cursor.getCount()  0)
  {
  cursor.moveToFirst();
  for (int i = 0; i 
   cursor.getCount(); i++)
  {
  threadId =
   cursor.getLong(i);
  }
  }
  }
  finally
  {
  cursor.close();
  cursor = null;
  }
  }
  return threadId;
  }
 
   This is creating new thread id if its not exits in the sms-mms
   database.
 
   I have refered Threads class code from
  http://hi-android.info/src/android/provider/Telephony.java.html.
   This clearly indicates that new thread will get generated if it does
   not exists.
 
   In our application we are trying to get all conversations/messages for
   the contacts used. We are fetching conversations/message data on the
   basis of threadId which we are getting from above method call. Now
   even if a particular contact does not have any message thread
   available in message store, an empty message is getting generated. And
   in native message application the newly generated message thread with
   subject line as (No subject) is getting displayed.
 
   I want to avoid this. If there is no message for a particular contact
   I want to get thread id as null or 0. Do you know how can I
   achieve this?
 
   Or do you have any other suggetion to avoid above mentioned scenario?
 
   Note: The device I have used is HTC-Nexus One. And the android version
   used is 2.2.1.
 
   Thanks,
   Madhavi
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en- Hide quoted
 text -
 
  - Show quoted text -

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

Re: [android-developers] Mms-Sms database Thread Id Issue

2011-02-16 Thread sukumar bhashyam
hi ,

Uri content://mms-sms doesn't point to any table in mmssms db, Its just a
base uri.

To check for address, I guess, you need to run below steps...

 -- First query canonical_addresses table and get the _id, If query has 0
count then address is not found.
 -- If not, then look for _id in threads table ( Threads.ContentUri) where
recipients_id is equal to id received in step 1.

On Wed, Feb 16, 2011 at 5:22 PM, Madhavi madhavi.har...@gmail.com wrote:

 Hi All,

 In my application I have tried to get thread id using following code.

 public static long getThreadIdFromAddress(ContentResolver resolver,
String address)
{
if (address == null)
{
return 0;
}
// Content URIs for SMS app, these may change in future SDK
Uri threadIdContentUri = Uri.withAppendedPath(Uri
.parse(content://mms-sms/), threadID);
String smsId = _id;
String threadRecipientQuery = recipient;
Uri.Builder uriBuilder = threadIdContentUri.buildUpon();
uriBuilder.appendQueryParameter(threadRecipientQuery,
 address);
long threadId = 0;
Cursor cursor = resolver.query(uriBuilder.build(),
new String[] { smsId }, null, null, null);
if (cursor != null)
{
try
{
if (cursor.getCount()  0)
{
cursor.moveToFirst();
for (int i = 0; i 
 cursor.getCount(); i++)
{
threadId =
 cursor.getLong(i);
}
}
}
finally
{
cursor.close();
cursor = null;
}
}
return threadId;
}

 This is creating new thread id if its not exits in the sms-mms
 database.

 I have refered Threads class code from
 http://hi-android.info/src/android/provider/Telephony.java.html.
 This clearly indicates that new thread will get generated if it does
 not exists.

 In our application we are trying to get all conversations/messages for
 the contacts used. We are fetching conversations/message data on the
 basis of threadId which we are getting from above method call. Now
 even if a particular contact does not have any message thread
 available in message store, an empty message is getting generated. And
 in native message application the newly generated message thread with
 subject line as (No subject) is getting displayed.

 I want to avoid this. If there is no message for a particular contact
 I want to get thread id as null or 0. Do you know how can I
 achieve this?

 Or do you have any other suggetion to avoid above mentioned scenario?

 Note: The device I have used is HTC-Nexus One. And the android version
 used is 2.2.1.

 Thanks,
 Madhavi




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

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

Re: [android-developers] Calling WebView.addJavascriptInterface after onPageFinished

2011-01-20 Thread sukumar bhashyam
Try this...

 mWebView.loadUrl(javascript:window.MyLateJavaObject.callableFunction(););


On Thu, Jan 20, 2011 at 11:13 PM, jamesh jameshug...@gmail.com wrote:

 Hi,

 I'm trying to add Java objects to a WebView, such that they are
 available to Javascript.

 I can prove that if I do:

 mWebView.addJavascriptInterface(myAvailableAtLoadTimeObject,
 MyJavaObject);
 mWebView.load(file:///android_assets/index.html);

 I can call methods from Javascript:

 MyJavaObject.callableFunction(); // callableFunction is a Java method
 on myAvailableAtLoadTimeObject.

 or from Java:
 mWebView.loadUrl(javascript:MyJavaObject.callableFunction(););

 However, if WebViewClient.onPageFinished() has occurred, and then I
 try:

 mWebView.addJavascriptInterface(myAvailableOnlyLaterObject,
 MyLateJavaObject);
 mWebView.loadUrl(javascript:MyLateJavaObject.callableFunction(););

 I get an error reported from Javascript:
 Uncaught ReferenceError: MyLateJavaObject is not defined

 What am I missing, or doing wrong?

 Thanks,

 James

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

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

Re: [android-developers] google.com search button select issue on WebView

2011-01-07 Thread sukumar bhashyam
Ya, 
setJavaScriptEnabledhttp://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled%28boolean%29
is enabled. Am I missing any other settings?

On Fri, Jan 7, 2011 at 7:06 PM, Kostya Vasilyev kmans...@gmail.com wrote:

  Did you enable JavaScript for your WebView?


 http://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean)http://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled%28boolean%29

 -- Kostya

 07.01.2011 16:19, sukumar bhashyam пишет:

 hi,

 My app, which uses webview shows google.com as default page. I'm not
 able to select the Search button after entering some text in google's page
 search editor. ADB logs is showing below errors. The same use-case works
 fine with default browser. I could verify the urls  user-agent
 launched/sent by Browser and my app are same.

 I enabled setJavaScriptEnabled to true. Any Idea why does google.comdoesn't 
 work properly in my App. Am I missing any settings here?. I'm also
 attaching the google page loaded by my app for reference. Thanks.


 01-07 18:23:32.647: ERROR/Web Console(2545): Uncaught TypeError: Cannot
 call method 'getItem' of null at http://www.google.co.in/:296
 01-07 18:23:49.006: ERROR/dalvikvm(3091): could not disable core file
 generation for pid 3091, errno=1
 01-07 18:23:49.186: ERROR/GlobalUnplugService(3091): plugged =
 true,mBatteryPlugged=false
 01-07 17:08:04.285: ERROR/ThrottleService(1343): Could not open GPS
 configuration file /etc/gps.conf
 01-07 17:08:04.613: ERROR/NetworkManagmentService(1343): Unexpected
 response code 600
 01-07 18:23:16.944: ERROR/Web Console(2545): Uncaught TypeError: Cannot
 call method 'getItem' of null at http://www.google.co.in/:258
 01-07 18:23:16.967: ERROR/Web Console(2545): Uncaught TypeError: Cannot
 call method 'getItem' of null at http://www.google.co.in/:282
 01-07 18:23:18.006: ERROR/Web Console(2545): Uncaught TypeError: Cannot
 call method 'getItem' of null at http://www.google.co.in/:31
 01-07 18:23:32.647: ERROR/Web Console(2545): Uncaught TypeError: Cannot
 call method 'getItem' of null at http://www.google.co.in/:296
 01-07 18:23:49.006: ERROR/dalvikvm(3091): could not disable core file
 generation for pid 3091, errno=1
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



 --
 Kostya Vasilyev -- WiFi Manager + pretty widget -- 
 http://kmansoft.wordpress.com

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

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

[android-developers] Query regarding Intent.get Extras.

2010-08-11 Thread sukumar bhashyam
hi,

Please help me in clarifying below query

#1. Any Data( Bundle) passed into Intent.putExtras is going to create a new
copy of Bundle instance or its going to have reference to the Bundle
passed?.

#2 Same query with get, Any call made to Intent.getExtras is going to new
Instance of Bundle or reference to extras in Intent?.

Regards,
Sukumar.

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

[android-developers] Re: Issue with legacy phones URI.

2010-06-15 Thread sukumar bhashyam
Hello

Can anyone please comment

Regards,
Sukumar.




On Mon, Jun 14, 2010 at 7:07 PM, sukumar bhashyam 
bhashyam.suku...@gmail.com wrote:

 hi,

 My app needs contacts id, display name and phone number in a single query.
 I see legacy uri android.provider.Contacts.Phones.CONTENT_URI suits me the
 best. For some reasons query on this uri return me 0.

 I looked into the LegacyApiSupport.java, legacy PHONES table is mapped to a
 view (view_v1_phones). I pulled the Contacts2.db and found that
 'view_v1_phones' is valid and its listing the data as I needed.

 If view_v1_phones is valid, why does my query fails Below is the code
 snippet I have used...

Cursor resultPhone =
 getContentResolver().query(android.provider.Contacts.Phones.CONTENT_URI,
 null, null,
 null, null);
 if(resultPhone != null  resultPhone.getCount() != 0) {
  //printResults( resultPhone );
 }else {
 if(resultPhone == null)
 Log.i(suku,cursor null);
 else
 Log.i(suku,results 0);
 }


 Can I get contacts id, display name and phone number in a single query
 using ContactsContracts?


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

2010-06-14 Thread sukumar bhashyam
hi,

My app needs contacts id, display name and phone number in a single query. I
see legacy uri android.provider.Contacts.Phones.CONTENT_URI suits me the
best. For some reasons query on this uri return me 0.

I looked into the LegacyApiSupport.java, legacy PHONES table is mapped to a
view (view_v1_phones). I pulled the Contacts2.db and found that
'view_v1_phones' is valid and its listing the data as I needed.

If view_v1_phones is valid, why does my query fails Below is the code
snippet I have used...

   Cursor resultPhone =
getContentResolver().query(android.provider.Contacts.Phones.CONTENT_URI,
null, null,
null, null);
if(resultPhone != null  resultPhone.getCount() != 0) {
 //printResults( resultPhone );
}else {
if(resultPhone == null)
Log.i(suku,cursor null);
else
Log.i(suku,results 0);
}


Can I get contacts id, display name and phone number in a single query using
ContactsContracts?

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

Re: [android-developers] Re: Prepare VCard in android

2010-05-19 Thread sukumar bhashyam
APIs not exposed in Android Framework. But, code for parsing/composing
v-card is available in android git. Check below link, you can use this in
your code.

http://code.google.com/p/android-vcard/source/browse/branches/android2-merge/android-vcard/src2/android/pim/vcard/VCardComposer.java

On Tue, May 18, 2010 at 8:54 PM, Soumya soumyakanti...@gmail.com wrote:

 Isn't there any API to create a vcard with my own data in android?

 On May 18, 5:19 pm, Soumya soumyakanti...@gmail.com wrote:
  Hi,
 
  I am preparing a contacts application and would like to support the
  VCard export. Can anyone tell me if there is any API I can use to
  create a VCard.
 
  Thank you,
  Soumya
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group athttp://
 groups.google.com/group/android-developers?hl=en

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


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

[android-developers] Re: AbstractAccountAuthenticator.getAccountRemovalAllowed query

2010-03-16 Thread sukumar bhashyam
Can anyone pls respond?

On Fri, Mar 12, 2010 at 3:20 PM, sukumar bhashyam 
bhashyam.suku...@gmail.com wrote:

 hi,

 I'm trying to create a sync account which should not be deleted by user (
 On selecting RemoveAccounts from Accounts settngs).

 For that, I overriden getAccountRemovalAllowed() function. From the java
 docs (@
 http://developer.android.com/reference/android/accounts/AbstractAccountAuthenticator.html)
  it says we can return a bundle with any of the below keys.

- 
 KEY_INTENThttp://../../../reference/android/accounts/AccountManager.html#KEY_INTENT,
or
- 
 KEY_BOOLEAN_RESULThttp://../../../reference/android/accounts/AccountManager.html#KEY_BOOLEAN_RESULT,
true if the removal of the account is allowed, false otherwise
- 
 KEY_ERROR_CODEhttp://../../../reference/android/accounts/AccountManager.html#KEY_ERROR_CODEand

 KEY_ERROR_MESSAGEhttp://../../../reference/android/accounts/AccountManager.html#KEY_ERROR_MESSAGEto
  indicate an error

 The problem I'm seeing is, it always shows the same Dialog on selecting
 Remove account even if I return any key bundle ( KEY_INTENT,
 BOOLEAN,ERROR_CODE).

 I wanted to shown my own custom activity with the reason for not deleting.
 I'm creating the Intent of my custom activity and returning it in Bundle
 from getAccountRemovalAllowed() api. Instead launching my custom activity,
 Its showing a Dialog with text This account is required by some
 applications, You can only

 Please let me know, If I missed something?. Thanks.

 Regards,
 Sukumar.


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

[android-developers] AbstractAccountAuthenticator.getAccountRemovalAllowed query

2010-03-12 Thread sukumar bhashyam
hi,

I'm trying to create a sync account which should not be deleted by user ( On
selecting RemoveAccounts from Accounts settngs).

For that, I overriden getAccountRemovalAllowed() function. From the java
docs (@
http://developer.android.com/reference/android/accounts/AbstractAccountAuthenticator.html)
it says we can return a bundle with any of the below keys.

   - 
KEY_INTENT../../../reference/android/accounts/AccountManager.html#KEY_INTENT,
   or
   - 
KEY_BOOLEAN_RESULT../../../reference/android/accounts/AccountManager.html#KEY_BOOLEAN_RESULT,
   true if the removal of the account is allowed, false otherwise
   - 
KEY_ERROR_CODE../../../reference/android/accounts/AccountManager.html#KEY_ERROR_CODEand
   
KEY_ERROR_MESSAGE../../../reference/android/accounts/AccountManager.html#KEY_ERROR_MESSAGEto
indicate an error

The problem I'm seeing is, it always shows the same Dialog on selecting
Remove account even if I return any key bundle ( KEY_INTENT,
BOOLEAN,ERROR_CODE).

I wanted to shown my own custom activity with the reason for not deleting.
I'm creating the Intent of my custom activity and returning it in Bundle
from getAccountRemovalAllowed() api. Instead launching my custom activity,
Its showing a Dialog with text This account is required by some
applications, You can only

Please let me know, If I missed something?. Thanks.

Regards,
Sukumar.

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

[android-developers] Cannot sendBroadcast Intent to receiver which has permission.

2010-03-11 Thread sukumar bhashyam
hi All,

I created a broadcast receiver with permission as below,

  receiver  android:name=.TestReceiverPermission
  android:permission=com.suku.test
 intent-filter
action android:name=suku.TestReceiverPermission
/
/intent-filter
  /receiver

Also, In my Manifest file, I added uses permission ( uses-permission
android:name=com.suku.test/).

When I try to broadcast Intent, I'm getting the following error,

03-12 10:00:16.484: WARN/ActivityManager(1215): Permission Denial:
broadcasting Intent { act=suku.TestReceiverPermission } from
com.suku.HelloWorld (pid=1649, uid=10081) requires com.suku.test due to
receiver com.suku.HelloWorld/com.suku.HelloWorld.TestReceiverPermission

Any Idea why I'm getting this error?. Any help would be appreciated. Thanks.

Regards,
Sukumar.

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

Re: [android-developers] Cannot sendBroadcast Intent to receiver which has permission.

2010-03-11 Thread sukumar bhashyam
hi Dianne,

I see following message while installing my app. Any reason for this?. In
the same manifest file I mentioned permission for receiver (
android:permission=com.suku.
test).

03-12 11:35:12.945: WARN/PackageManager(1215): Unknown permission
com.suku.test in package com.suku.HelloWorld

Regards,
Sukumar.



On Fri, Mar 12, 2010 at 10:51 AM, Dianne Hackborn hack...@android.comwrote:

 Your app apparently does not have that permission.  Are there any messages
 printed in the log when installing it saying why it was not granted?

 On Thu, Mar 11, 2010 at 9:11 PM, sukumar bhashyam 
 bhashyam.suku...@gmail.com wrote:

 hi All,

 I created a broadcast receiver with permission as below,

   receiver  android:name=.TestReceiverPermission
   android:permission=com.suku.test
  intent-filter
 action android:name=suku.TestReceiverPermission
 /
 /intent-filter
   /receiver

 Also, In my Manifest file, I added uses permission ( uses-permission
 android:name=com.suku.test/).

 When I try to broadcast Intent, I'm getting the following error,

 03-12 10:00:16.484: WARN/ActivityManager(1215): Permission Denial:
 broadcasting Intent { act=suku.TestReceiverPermission } from
 com.suku.HelloWorld (pid=1649, uid=10081) requires com.suku.test due to
 receiver com.suku.HelloWorld/com.suku.HelloWorld.TestReceiverPermission

 Any Idea why I'm getting this error?. Any help would be appreciated.
 Thanks.

 Regards,
 Sukumar.

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




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

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

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


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

Re: [android-developers] Cannot sendBroadcast Intent to receiver which has permission.

2010-03-11 Thread sukumar bhashyam
I got the problem..Need to create permission in the manifest file.

 permission
 android:name=com.suku.test 
 /permission

On Fri, Mar 12, 2010 at 11:41 AM, sukumar bhashyam 
bhashyam.suku...@gmail.com wrote:

 hi Dianne,

 I see following message while installing my app. Any reason for this?. In
 the same manifest file I mentioned permission for receiver (
 android:permission=com.suku.
 test).

 03-12 11:35:12.945: WARN/PackageManager(1215): Unknown permission
 com.suku.test in package com.suku.HelloWorld

 Regards,
 Sukumar.




 On Fri, Mar 12, 2010 at 10:51 AM, Dianne Hackborn hack...@android.comwrote:

 Your app apparently does not have that permission.  Are there any messages
 printed in the log when installing it saying why it was not granted?

 On Thu, Mar 11, 2010 at 9:11 PM, sukumar bhashyam 
 bhashyam.suku...@gmail.com wrote:

 hi All,

 I created a broadcast receiver with permission as below,

   receiver  android:name=.TestReceiverPermission
   android:permission=com.suku.test
  intent-filter
 action android:name=suku.TestReceiverPermission
 /
 /intent-filter
   /receiver

 Also, In my Manifest file, I added uses permission ( uses-permission
 android:name=com.suku.test/).

 When I try to broadcast Intent, I'm getting the following error,

 03-12 10:00:16.484: WARN/ActivityManager(1215): Permission Denial:
 broadcasting Intent { act=suku.TestReceiverPermission } from
 com.suku.HelloWorld (pid=1649, uid=10081) requires com.suku.test due to
 receiver com.suku.HelloWorld/com.suku.HelloWorld.TestReceiverPermission

 Any Idea why I'm getting this error?. Any help would be appreciated.
 Thanks.

 Regards,
 Sukumar.

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




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

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

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




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

Re: [android-developers] My Widget is Locking up Android OS

2010-03-03 Thread sukumar bhashyam
Don't pass AppWidgetManager instance to MyTime class. Instead use
AppWidgetManager.getInstance() to get an instance of AppWidgetManager.

On Wed, Mar 3, 2010 at 10:04 AM, themindiswasted abarban...@gmail.comwrote:

 Can someone look at this code and see why it is locking up the Android
 OS. I am receiving force close messages on a.core after about a
 minute.

 Thank you so much in advance:

 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.Locale;
 import java.util.Timer;
 import java.util.TimerTask;

 import android.appwidget.AppWidgetManager;
 import android.appwidget.AppWidgetProvider;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.widget.RemoteViews;

 public class HelloWidget extends AppWidgetProvider {
Calendar cal = new GregorianCalendar();
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_MONTH);


//@Override
public void onUpdate(Context context, AppWidgetManager
 appWidgetManager,int[] appWidgetIds) {
Timer timer = new Timer();
timer.scheduleAtFixedRate(new MyTime(context,
 appWidgetManager), 1,
 1000);
}

private class MyTime extends TimerTask {
RemoteViews remoteViews;
AppWidgetManager appWidgetManager;
ComponentName thisWidget;
DateFormat format =
new SimpleDateFormat(HH:mm:ss,Locale.getDefault());
//DateFormat format =
 SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM,
//Locale.getDefault());


public MyTime(Context context, AppWidgetManager
 appWidgetManager)
 {
this.appWidgetManager = appWidgetManager;
remoteViews = new
 RemoteViews(context.getPackageName(),
 R.layout.main);
thisWidget = new ComponentName(context,
 HelloWidget.class);
remoteViews.setTextViewText(R.id.widget_dateView,
day + . + (month + 1) + . +
 year);
}

@Override
public void run() {
remoteViews.setTextViewText(R.id.widget_textview,
format.format(new Date()));

appWidgetManager.updateAppWidget(thisWidget, remoteViews);
}
}

//@Override
public void onReceive(Context context, Intent intent) {
// v1.5 fix that doesn't call onDelete Action
final String action = intent.getAction();
if
 (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) {
final int appWidgetId = intent.getExtras().getInt(
AppWidgetManager.EXTRA_APPWIDGET_ID,

  AppWidgetManager.INVALID_APPWIDGET_ID);
if (appWidgetId !=
 AppWidgetManager.INVALID_APPWIDGET_ID) {
this.onDeleted(context, new int[] {
 appWidgetId });
}
} else {
super.onReceive(context, intent);
 }
}
 }

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


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

Re: [android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-19 Thread sukumar bhashyam
AddAccountExplicitly() would need Authenticator of same type.

I created an Authenticator and called AddAccountExplicitly() for the same
type which created an account ( Could verify it from
AccountManager.getAccounts())

One strange thing I observer is none of the  implementation class functions
of AbstractAccountAuthenticator is being called. I followed the exact steps
in documentation. Not even onCreate or onBind function is called. Anyone
seen this problem?. Is your AbstractAccountAuthenticator implemetation class
being invoked?.
Thanks.

On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote:

 Dan,

 Thanks for all of this.  I just returned to the office and will be
 taking a look to see how much further I can get and I will certainly
 be interested in helping with your accounts project.

 I got as far as getting my account to show up in the list of accounts
 along with Google, Facebook and Exchange, but my service never gets
 called.  My addAccount() method doesn't return an intent, but rather
 KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
 account request succeed.

 My goal is to create an account that will only be used by my
 application and does not need to have any features to enable external
 authentication or account configuration.

 I've also tried AddAccountExplicitly() but I can't seem to get around
 its UID restrictions.  The calling activity and the authenticator
 service all belong to the same application so I'm not sure why the
 system still throws an error about the UID not being correct.

 Cheers,
 Jerry

 On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
  For anyone still interested.I've made a bit of progress.   The google
  project below now creates and lists accounts of the type for the project!
 
 
 
  On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote:
   To facilitate the discussion around this topic, I've started up a
 project
   over here:
  http://code.google.com/p/androidaccounts/
 
   http://code.google.com/p/androidaccounts/If anyone is interested in
   pitching in and writing some examples, let me know so I can add you.
   The current state of the project is as far as I've gotten to
 understanding
   what is available so far... and I'm stumped as to why new accounts
 don't
   seem to persist after their creation ( as far as the AccountsTester app
 is
   concerned ).
 
   On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote:
 
   I've gotten a bit further than you.
 
   The account manager seems to want to store AccountName+Type pairs, and
   have an AccountAuthenticator handle the storage and dirty bits of the
 actual
   authentication and credential storage.
 
   You will need to create an AccountAuthenticator from the
   AbstractAccountAuthenticator class.
   You will also need to define a Service in your app.   See
  http://developer.android.com/reference/android/accounts/AbstractAccou.
 ..
   This service must be set up in the Manifest like so:  (ripped from
 link
   above)
 
intent-filter
action android:name=android.accounts.AccountAuthenticator /
  /intent-filter
  meta-data android:name=android.accounts.AccountAuthenticator
android:resource=@xml/authenticator /
 
   You can take a look at the link for what the resource must be...
 
   After you end up hooking all that crap up, you can do this in your
   service:
public IBinder onBind(Intent intent) {
IBinder ret = null;
if
  
 (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC
 ATOR_INTENT))
ret = getAuthenticator().getIBinder();
return ret;
}
 
   private AccountAuthenticator getSametimeAuthenticator() {
if (_aa == null)
   _aa = new AccountAuthenticator(this);
   return _aa;
}
 
   So when you finally have all this set up.You should see your
 account
   type listed in the AccountTester application next to the Corporate
 type.
   To get anything meaningful to happen when you click Add, you need to
 do
   this in your AccountAuthenticator:
 
   public Bundle addAccount(AccountAuthenticatorResponse response, String
   accountType, String authTokenType, String[] requiredFeatures, Bundle
   options) throws NetworkErrorException {
Bundle ret = new Bundle();
Intent intent = new Intent(_context,
   AccountAuthenticatorActivity.class);
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,
   response);
ret.putParcelable(AccountManager.KEY_INTENT, intent);
   return ret;
   }
 
   This basically says that...   I'm going to prompt the user to enter
   credentials using the MyAccountAuthenticatorActivity class.
   The MyAccountAuthenticatorActivity activity should probably extend the
   class AccountAuthenticatorActivity.   Here's mine:
 
   public class MyAccountAuthenticatorActivity extends
   AccountAuthenticatorActivity {
   protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
   

Re: [android-developers] Re: Working with the new ContactContracts API

2009-11-09 Thread sukumar bhashyam
hi Dmitri,

Thanks for throwing some light on SyncAdapters. Once a new sync account and
sync adapter is created ( By inherting AbstractThreadedSyncAdapter) for a
sync application,how does any other application wants to call sync for the
same sync app will bind?. Was it through SyncManager or through
ContentResolver.requestSync(). What is the api should other apps call to
bind to my sync application?.

Could you please let us know some more details of SyncManager and Sync
Adapter relation. What should I do to add my AbstractAdapter to SyncManager.
Thanks.

Regards,
Sukumar.


On Sat, Nov 7, 2009 at 12:51 AM, Dmitri Plotnikov dplotni...@google.comwrote:

 Privet Vadim,

 A sync adapter is a service whose job is to sync data between a back end
 and the phone. It is typically kicked-off automatically on a schedule.  Sync
 adapters are managed by sync manager, which knows when to start them, avoids
 running multiple at the same time and does a bunch of other useful stuff.
  You will want to inherit from android.content.AbstractThreadedSyncAdapter.

 Also, see if it makes sense for you to have a separate account.  Then
 instead of dropping new contacts to the Gmail or Exchange servers you would
 just bring them to the phone.  Your contacts will get nicely aggregated with
 other contacts on the phone.

 I hope this helps.
 - Dmitri

 On Fri, Nov 6, 2009 at 3:01 AM, Vadim Vohmjanin vadim...@gmail.comwrote:

 Privet Dmitri,

 I have been searching for the second day any info about what Sync
 Adapter is and any info that could help me to understand if i need to
 implement it.
 We are writing an application that syncs contacts. I just try to
 understand if Sync Adapter will be any helpful.
 And Google didn't provide any sources of 2.0 sdk yet, and
 documentation of APIs is also very poor.

 On Nov 5, 6:39 am, Dmitri Plotnikov dplotni...@google.com wrote:
  Raw contacts can have group memberships.  A GroupMembership is a row in
 the
  Data table.  If you want to add a membership find the group you need and
 add
  a row to the Data table with mimetype GroupMembership.CONTENT_ITEM_TYPE
 and
  the id of the group:
 
  values.put(GroupMembership.RAW_CONTACT_ID, rawContactId);
  values.put(GroupMembership.MIMETYPE, GroupMembership.CONTENT_ITEM_TYPE);
  values.put(GroupMembership.GROUP_ROW_ID, groupId);
  resolver.insert(Data.CONTENT_URI, values);*
 
  *If you are writing a sync adapter, you may find it easier to use
  server-side group ID instead of a row ID:
  values.put(GroupMembership.GROUP_SOURCE_ID, blahblah);
 
  Groups do not affect aggregation and are not affected by aggregation.
 
  Cheers,
  - Dmitri
 
  On Wed, Nov 4, 2009 at 7:28 PM, Yao cicikaka2...@gmail.com wrote:
   Hi Dmitri,
 
   Would you please help point out how's new group structure? Something
   similar as groupmembership table in previous relese. Thanks a lot in
   advance!
 
   On Thu, Nov 5, 2009 at 10:47 AM, Dmitri Plotnikov 
 dplotni...@google.comwrote:
 
   Hi Jake,
 
   The database structure is actually extremely straightforward:
 
   Contacts represents an aggregated contact
   RawContacts represents a contact as it was inserted by the sync
 adapter.
RawContact has a CONTACT_ID field that binds it to a Contact.
   Data represents everything about a RawContact: emails, phone
 numbers,
   notes, birthday, high school graduation year, you name it.  Data has
 a
   RAW_CONTACT_ID field that binds it a  RawContact.  The other
 important field
   is MIMETYPE.  That's what determines the kind of data stored in a
 Data row.
Everything else is just convenience API.
 
   So here's the most common way of inserting a data row:
 
   values.put(Data.RAW_CONTACT_ID, rawContactId);
   values.put(Data.MIMETYPE, Note.CONTENT_ITEM_TYPE);
values.put(Note.NOTE, Blah blah blah);
   resolver.insert(Data.CONTENT_URI, values);
 
   I hope this helps.
 
   - Dmitri
 
   On Wed, Nov 4, 2009 at 6:11 PM, jak. koda...@gmail.com wrote:
 
   Thank you Dmitri,
 
   Your response was very helpful. Along with that, and the sample you
   posted on another thread about using both Contact Apis from one app,
   I've gotten most of the way there. It is much appreciated.
 
   I'm still however having some problems that I'm hard pressed to find
 a
   solution for.
   I'd be grateful if anyone could help me.
 
   The biggest challenge I'm  having with this API is that it's hard
 for
   me to picture how the tables are laid out so I know which URI to
 query
   to get the parts of the contact that I'm interested in.
   I found to get the email address for a contact I'm looking at I can
   query the uri:ContactsContract.CommonDataKinds.Email.CONTENT_URI,
   looking at rows of the contact id i'm interested in.
 
   However to get the note from the same contact I can't use a similar
   pattern, because there is no
   ContactsContract.CommonDataKinds.Note.CONTENT_URI
   The Note type exists in CommonDataKinds but it doesn't have an
   associated CONTENT_URI.
 
   I'm finding it 

Re: [android-developers] Re: Working with the new ContactContracts API

2009-11-09 Thread sukumar bhashyam
hi Dmitri,

Could you please answer my post regarding syncAdapters in the same thread.
Pasting it again below.
 Thanks for throwing some light on SyncAdapters. Once a new sync
account and sync adapter is created ( By
inherting AbstractThreadedSyncAdapter) for a sync application,how does any
other application wants to call sync for the same sync app will bind?. Was
it through SyncManager or through ContentResolver.requestSync(). What is the
api should other apps call to bind to my sync application?.

Could you please let us know some more details of SyncManager and Sync
Adapter relation. What should I do to add my AbstractAdapter to SyncManager.
Thanks.

Regards,
Sukumar.

On Tue, Nov 10, 2009 at 11:10 AM, Dmitri Plotnikov dplotni...@google.comwrote:

 The way you are setting ringtones looks right.  Setting them on the
 aggregate contact is the right way to go.  Can you see any pattern?  Is
 there anything in common between the contacts that don't take the ringtone?
 Can you set the ringtone on those using the standard Contacts app?

 Thank you
 Dmitri

 On Nov 9, 2009 10:40 AM, jarkman jark...@gmail.com wrote:

 Dmitri - could I ask you another question ?

 We are setting custom ringtones for contacts:

 Uri contactUri; // eg: content://com.android.contacts/contacts/12

 ContentValues values = new ContentValues();
 values.put(ContactsContract.Contacts.CUSTOM_RINGTONE,
 newRingtoneUri.toString());
 context.getContentResolver().update(contactUri, values, where, args );

 In the field, this seems to work for some contacts, but not for
 others.

 Should we be setting the ringtone on the aggregated contact, like
 this, or on all the individual raw contacts ?


 Thanks again,

 Richard

 On Nov 5, 8:17 pm, Dmitri Plotnikov dplotni...@google.com wrote: 
 Right.   Setting the new phot...

  On Thu, Nov 5, 2009 at 12:04 PM, jarkman jark...@gmail.com wrote:  
 Oops! I see what you mean

  ...   read more » -- You received this message because you are
 subscribed to the Google Groups...

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


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

[android-developers] Re: Android 2.0 Force close in contacts app

2009-10-28 Thread sukumar bhashyam
hi Xav,

Andorid 2.0 SDK release page talks more about Contacts Sync Adaptor, which
is not supported in Official Android 2.0 SDK.

Could you please let me know when it will be supported. Will there be
another 2.0 SDK release with Sync Adaptor changes?.

Regards,
Sukumar.


On Wed, Oct 28, 2009 at 5:23 AM, Xavier Ducrohet x...@android.com wrote:


 this is a known issue. However, note that the system image for 2.0
 does not include any sync adapters so you wouldn't be able to add any
 account anyway.

 Xav

 On Tue, Oct 27, 2009 at 2:20 PM, Alexey alex...@gmail.com wrote:
 
  When I launch Contacts app in the emulator for API level 5, then go to
  Menu - Accounts, I get exception. Anyone else see this. How to try new
  multiple Accounts feature?
 
  
 



 --
 Xavier Ducrohet
 Android SDK Tech Lead
 Google Inc.

 Please do not send me questions directly. Thanks!

 


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



[android-developers] Deep sleep behaviour

2009-09-08 Thread sukumar bhashyam
Hello,
I have some basic doubts with Deep Sleep on Android device. Deep sleep will
turn the CPU to OFF. Suppose if I have a service which does some operations
every 5 sec and I din't acquire any power manager locks in my service.

When device goes to Deep sleep, will my service still running?.

If CPU is turned off on Deep Sleep, when Device comes out of Deep Sleep,
will my service continues(resumes) its operations which it was doing
earlier?.

Can anyone please help me out in understanding this.

Thanks,
Sukumar.

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



[android-developers] CPU usage api's query

2009-07-15 Thread sukumar bhashyam
Hello,
I'm trying to develop a service, which needs to be run in background as a
 low priority task and does some complex processing . I need to gracefully
quit my service when their is a resource shortage( like CPU running low on
memory). Was there any APIs available to know the CPU resource usage ?.
Objectives of my service is to -
   1. Exit service when a high priority application(s) is running and which
 might need entire CPU resources.
  2. Should store my states before onDestroy() of my service is called.

I'm planning to use CPU resource usage api's in service to
check periodically the CPU load and quit the service if CPU load exceed a
threshold(80 %) after storing states. Please let me know of any better way
of handling the objectives of my service stated above. Thanks.

Regards,
Sukumar.

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



[android-developers] Not able to launch an activity of other app from Tab activity.

2009-06-03 Thread sukumar bhashyam
Hi,

  I am getting the following exception when I call an activity1 (
resides in 1.apk) using the following intent from TabActivity
(activity 2 resides in 2.apk)


Intent tab1intent = new Intent();  tab1intent.setAction(
android.intent.action.VIEW);  tab1intent.addCategory(
android.intent.category.DEFAULT);

tab1intent.setType(vnd.android.activity/vnd.moto.BookmarkManagerActivity);
tab1intent.putExtra(BROWSER LAUNCH, true);

Any suggestion how do I handle this error.

Appreciate your great help

Thanks


05-27 19:23:33.311: INFO/ActivityManager(570): Starting activity: Intent {
comp={com. moto.myFamily/com. moto.myFamily.familyTab} (has extras) }
05-27 19:23:33.730: WARN/dalvikvm(761): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
05-27 19:23:33.739: ERROR/AndroidRuntime(761): Uncaught handler: thread main
exiting due to uncaught exception
05-27 19:23:33.841: ERROR/AndroidRuntime(761): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{com. moto.myFamily/com. moto.myFamily.familyTab}:
java.lang.SecurityException: Requesting code from
com. moto.bookmarkmanager (with uid 10018) to be run in process
com. moto.myFamily (with uid 10019)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.os.Handler.dispatchMessage(Handler.java:99)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.os.Looper.loop(Looper.java:123)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.main(ActivityThread.java:3948)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
java.lang.reflect.Method.invokeNative(Native Method)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
java.lang.reflect.Method.invoke(Method.java:521)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
dalvik.system.NativeStart.main(Native Method)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): Caused by:
java.lang.SecurityException: Requesting code from
com. moto.bookmarkmanager (with uid 10018) to be run in process
com. moto.myFamily (with uid 10019)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.getPackageInfo(ActivityThread.java:1932)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.startActivityNow(ActivityThread.java:2112)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:600)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.widget.TabHost.setCurrentTab(TabHost.java:310)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.widget.TabHost.addTab(TabHost.java:203)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
com. moto.myFamily.familyTab.onCreate(familyTab.java:60)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
05-27 19:23:33.841: ERROR/AndroidRuntime(761): ... 11 more
05-27 19:23:33.891: INFO/Process(570): Sending signal. PID: 761 SIG: 3
05-27 19:23:33.891: INFO/dalvikvm(761): threadid=7: reacting to signal 3

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 share non-sqlite( shared Preference) data over Content Provider.

2009-05-28 Thread sukumar bhashyam
hi,
I looked into some examples of sharing data to other apps using content
Provider. All these examples talks about sharing sqlite dbs. I need to share
data under shared Preferences of my app to other apps using content
Provider.

Can I use content Provider to do that ?. Please let me know some pointers or
sample code to share data other than sqlite db using content provider.


Thanks,
Sukumar.

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



[android-developers] Re: InstrumentationTestRunner on G1

2009-03-17 Thread sukumar bhashyam
hi Fred,

CheckJNI has nothing to do with testRunner. Din't remember the exact cause
why it was not running on phone. But, it started working after sometime(
might be problem with my code ).

Sukumar.

On Tue, Dec 30, 2008 at 3:12 PM, sukumar bhashyam.suku...@gmail.com wrote:


 hi,

 I'm facing problems running TestRunner on G1 phone. I haven't had any
 problems running on emulator.   Was there any setting I need to turn
 it ON on G1 phone?. Also from catlogs, for emulator CheckJNI is
 printed as ON but on phone its printed as OFF.  Is checkJNI has
 something to do with test runner ?. Thanks in advance.


 Sukumar.



 


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



[android-developers] Re: How to get the IMEI number of a android device programmatically?

2009-02-10 Thread sukumar bhashyam
Use TelephonyManager's getDeviceId().

On Tue, Feb 10, 2009 at 3:48 PM, manoj manojkumar.m...@gmail.com wrote:


 Hi frnds,

 I want get the IMEI number of a android device programmatically. But I
 dont know how to get it by writing a program.

 Can any one please help me to get the IMEI?

 Thanks,
 Manoj.
 


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