Re: [android-developers] Re: Application wake up

2010-05-11 Thread Timo Prill
Send binary SMS to the specific port on the phone, they won't be shown 
in the inbox..


(except the HTC Tattoo sometimes shows binary SMS in the inbox.. seems 
to be a device-specific bug)


cheers

Am 11.05.2010 15:36, schrieb SAM:

Hi,
Has anyone found any solution for Port directed SMS OR App directed
SMS in android?

Although the Inbox SMS hook is working but I am still unable to delete
this SMS from Inbox. I dont want user to see this SMS notification.

Thanks
Sam

On Apr 16, 5:04 pm, SAMgulati...@gmail.com  wrote:
   

Thanks Guys. Its working now.

So the process goes like this:
1. In your manifest file, make a activity and a receiver. Mention your
receiver class name here.
2. Make a entry foruses-permission  android:name =
android.permission.RECEIVE_SMS
3. To test on emulator, test by DDMS perspective view.
4. You application will receive SMS while its dead too. in
Onreceive(), read the SMS and do whatever you want. you can also start
your activity from here.

Thanks
sam

On Mar 19, 7:56 am, Andreasandreas.bex...@gmail.com  wrote:





 

Hi,
   
 

Please note that there is no longer any class called IntentReceiver.
It is now called BroadcastReceiver. Also, to get this to work, you
need to register the receiver in the AndroidManifest.xml like this:
   
 

 receiver android:name=.RespToSMS
 intent-filter
 action 
android:name=android.provider.Telephony.SMS_RECEIVED /
 /intent-filter
 /receiver
   
 

Regards,
Andreas
   
 

On Mar 18, 2:50 pm, Vaibhav Kulkarnivaibhavkul...@gmail.com  wrote:
   
 

Hi Sam,
 
 

I think you should create a service for that!!! You can use Intent for SMS
in following way
 
 

public class RespToSMS extends IntentReceiver {
 /* package name for Intent */
 static final String ACTION =
  android.provider.Telephony.SMS_RECEIVED;
 
 

 public void onReceiveIntent(Context context, Intent intent) {
  if (intent.getAction().equals(ACTION)) {
   StringBuilder buf = new StringBuilder();
  Bundle bundle = intent.getExtras();
   if (bundle != null) {
   SmsMessage[] messages =
Telephony.Sms.Intents.getMessagesFromIntent(intent);
   for (int i = 0; ilt; messages.length; i++) {
   SmsMessage message = messages[i];
   buf.append(message.getDisplayMessageBody());
  /* Check your SMS format and respond here... */
   }
   }
   NotificationManager nm = (NotificationManager)
context.getSystemService(
   Context.NOTIFICATION_SERVICE);
 
 

   nm.notifyWithText(123, buf.toString(),
   NotificationManager.LENGTH_LONG, null);
 
 

   }
  }
 
 

}
 
 

Thanks,
Vaibhav
 
 

On Thu, Mar 18, 2010 at 10:33 AM, SAMgulati...@gmail.com  wrote:
 

Hi,
I have a requirement to wake up my application upon receiving a
particular formatted SMS or App directed notification from server.
   
 

My application is in dead state. Whenever the device receives a event
may be a SMS in a particular format OR some notification(eg app
directed notification from server), android OS will start my
application.
   
 

Its possible in Windows Mobile and BREW.
   
 

Please let me know if its possible in Android and how.
   
 

Thanks
Sam
   
 

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubs限cr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en-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 
athttp://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
Groups Android Developers group.
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: APK files

2010-05-05 Thread Timo Prill

yes,

just rename it to .zip and you can extract some informations e.g. images 
/ sound...



Am 05.05.2010 12:13, schrieb grace:

hi,

i don't think so we can extract information from a apk file.

On May 5, 1:45 pm, Neilzneilhorn...@googlemail.com  wrote:
   

Hi all.

I just wondered, if someone has an application's APK file, can it be
extracted? I mean, can you open it to extract any images, sound files,
class files, xml files, etc?

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


[android-developers] Possible to call intent image gallery with scrolling to specific image?

2010-05-05 Thread Timo Prill

hi,

is it possible to call the native image gallery intent and pass an image 
uri (or s.th. else identifying an image) as
an intent's extra so that the gallery automatically scrolls to the 
specific image?


or maybe something similar?

cheers

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


Re: [android-developers] Is it possible to start an Activity from a non-context class?

2010-05-04 Thread Timo Prill
just pass your context over to the utility class via getter/setter or in 
constructor...



Am 04.05.2010 17:40, schrieb TreKing:
On Tue, May 4, 2010 at 2:02 AM, Michael J txaggiemich...@gmail.com 
mailto:txaggiemich...@gmail.com wrote:


For example, I have an activity that uses a utility class.  I
would like to be able to start an activity from the utility class
and have the activity result sent back to the utility class.


Why are you doing this? What purpose is your utility class serving 
that it requires starting and retrieving data from another activity?


-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en 


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] Widget with scrollable list of items

2010-04-27 Thread Timo Prill

hi,

i cannot find any example of a widget showing a scrollable list of items 
(e.g. text)

since the widget api says there is no listview, no scrollview etc.. at all,
how to implement a scrollable list inside a widget?

for example a list like friends-stream from HTC shows or many other 
widgets around


do i have to code my own list-implementation for a widget or am i just 
too blind?


anyone?


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


Re: [android-developers] How to show Low Battery Alert, when the battery power reduces to 15%.

2010-04-26 Thread Timo Prill

register a broadcastreceiver from a service or activity like this:

registerReceiver(myBatteryBroadcastReceiver, new 
IntentFilter(Intent.ACTION_BATTERY_CHANGED));


then in the receiver call:

intent.getIntExtra(level,0);

this will get you the current battery-charge

Am 26.04.2010 11:49, schrieb subrat kumar panda:

Hi all,
How to show Low Battery Alert , when the battery power reduces to 15%.
anybody knows the solution regarding the problem
please help me.

i am not getting any desired document or any code.

Thanking you in advance,

Best Regards
Subrat Kumar Panda
India

   


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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 delete a RAW contact in android 2.x without having the Aggregation contact ID

2010-04-21 Thread Timo Prill

hi

i am fighting against the 2.x contact api...

my problem is, i only have the RAW_CONTACT_ID of a contact.
i want to delete this raw contact programmatically.

i tried the following (even in a row):

this.cr.delete(ContactsContract.Contacts.CONTENT_URI,
ContactsContract.Contacts.Data.RAW_CONTACT_ID + EQUALS
+ rawContactID, null);

this.cr.delete(ContactsContract.RawContacts.CONTENT_URI,
ContactsContract.RawContacts.CONTACT_ID + EQUALS
+ rawContactID, null);

this.cr.delete(ContactsContract.Data.CONTENT_URI,
ContactsContract.Data.RAW_CONTACT_ID + EQUALS
+ rawContactID, null);

after these deletions, i see an empty contact called (Unknown) left in 
my Adress book.

this contact can not even be deleted via menu - delete.

now my question is, how can i delete a contact without having the 
aggregation contact id?

did i miss some table to go through?
is my only chance to set the deleted flag for the raw_contact_id?
and: if i never sync with a sync-adapter afterwards, will my deleted 
contact remain in the database forever?


scratching my head..
cheers
timo...

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] updating a contact in 2.x Contacts API

2010-04-19 Thread Timo Prill

hi all,

i got a problem updating a contact's details.
i use the following code to update the contact name:
operations is a ArrayList of ContentProviderOperation.


operations.add(ContentProviderOperation.newUpdate(
ContactsContract.Data.CONTENT_URI)
.withSelection(Data._ID + =?, new String[]{id})

.withValue(Data.MIMETYPE,StructuredName.CONTENT_ITEM_TYPE)

.withValue(StructuredName.GIVEN_NAME, firstName)
.withValue(StructuredName.FAMILY_NAME, lastName)
.build());

contentResolver.applyBatch(ContactsContract.AUTHORITY, operations);


but after this query, the contact name is not updated.. (at least the 
name did not change in the phone's addressbook)
i cant figure out why...what am i doing wrong? must be a simple thing i 
am missing..


thanks in advance
timo


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] updating a contact in 2.x Contacts API

2010-04-19 Thread Timo Prill

yeah, you are right, i was totally confused...
already found the error myself some time later..
i mixed up contact ID and data-row ID..
volcano-ash seemed to influence me this morning ;)

it now updates correctly using:

oerations.add(ContentProviderOperation.newUpdate(
ContactsContract.Data.CONTENT_URI).withSelection(
Data.CONTACT_ID + =?, new String[] { id }).withValue(
StructuredName.GIVEN_NAME, firstName)
.withValue(StructuredName.FAMILY_NAME, 
lastName).build());


but thx anyway for your reply! stupid-me! :)
cheers
timo


Am 19.04.2010 16:01, schrieb Dmitri Plotnikov:


What's the _id here? It should be the data row id, not the contact id. 
Also, you shouldn't specify the mime type in an update statement - it 
is not updatable.


Cheers,
Dmitri

On Apr 19, 2010 2:44 AM, Timo Prill timo.pr...@googlemail.com 
mailto:timo.pr...@googlemail.com wrote:

 hi all,

 i got a problem updating a contact's details.
 i use the following code to update the contact name:
 operations is a ArrayList of ContentProviderOperation.


 operations.add(ContentProviderOperation.newUpdate(
 ContactsContract.Data.CONTENT_URI)
 .withSelection(Data._ID + =?, new String[]{id})

 .withValue(Data.MIMETYPE,StructuredName.CONTENT_ITEM_TYPE)
 .withValue(StructuredName.GIVEN_NAME, firstName)
 .withValue(StructuredName.FAMILY_NAME, lastName)
 .build());

 contentResolver.applyBatch(ContactsContract.AUTHORITY, operations);


 but after this query, the contact name is not updated.. (at least the
 name did not change in the phone's addressbook)
 i cant figure out why...what am i doing wrong? must be a simple thing i
 am missing..

 thanks in advance
 timo


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
android-developers@googlegroups.com 
mailto:android-developers@googlegroups.com

 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com 
mailto:android-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 


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] Backporting an app to 1.5

2010-04-14 Thread Timo Prill

the dpi-specific folders were not available on 1.5.
they were introduced in 1.6.

you have to stick to the default-drawable-folder called drawable
same goes for the layout-folder and other DPI-dependant folders...

cheers
timo


Am 14.04.2010 16:50, schrieb Bob Lee:
We initially built our app for 2.1. Now, we're trying to get it 
working on 1.5.


I changed the target to 3 in default.properties, and I copied over 
the missing ant targets, but now I'm getting an error because 
drawable-hdpi is an invalid res directory name.


It looks like this is switching me to the old build tools. I'd like to 
use the latest tools but build against the 1.5 APIs. Am I missing 
something?


Thanks,
Bob

$ ant dogfood
Buildfile: build.xml
[setup] Project Target: Google APIs
[setup] Vendor: Google Inc.
[setup] Platform Version: 1.5
[setup] API level: 3

clean:

dirs:
 [echo] Creating output directories if needed...

resource-src:
 [echo] Generating R.java / Manifest.java from the resources...
 [exec] (skipping hidden file 
'/Users/crazybob/square/android/res/.DS_Store')
 [exec] (skipping hidden file 
'/Users/crazybob/square/android/res/drawable/.DS_Store')
 [exec] invalid resource directory name: 
/Users/crazybob/square/android/res/drawable-hdpi
 [exec] (skipping hidden file 
'/Users/crazybob/square/android/res/raw/.DS_Store')


BUILD FAILED
/Users/crazybob/android-sdk/platforms/android-3/templates/android_rules.xml:85: 
exec returned: 1


Total time: 0 seconds
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe, reply using remove me as the subject.


Re: [android-developers] How to detect blowing in to the microphone?

2010-04-08 Thread Timo Prill

check AudioRecord. this should do what you need.

http://developer.android.com/intl/de/reference/android/media/AudioRecord.html

cheers

Am 08.04.2010 10:04, schrieb Kakyoin:

How to detect blowing in to the microphone?

I saw an iPhone app which simulate flute instrument. You blow through
the mic and use your fingers to play. Can Android do that?

I've looked at the voice recognition in the API demos but it seems
that is not the case.

   


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe, reply using remove me as the subject.


Re: [android-developers] setting button images in drawable/xml

2010-03-25 Thread timo prill

you should go menu-Project-clean and let eclipse clean your project.
the android R files are then rebuilt so everything should be fine 
afterwards.


cheers


Wayne Wenthin schrieb:
I'll toss out what works for me.  The first thing I see is that I use 
ImageButton instead of just Button


?xml version=1.0 encoding=utf-8? 
selector xmlns:android=http://schemas.android.com/apk/res/android;

item android:state_window_focused=false android:state_enabled=true
android:drawable=@drawable/about_btn_normal /
item android:state_window_focused=false android:state_enabled=false
android:drawable=@drawable/about_btn_normal /
item android:state_pressed=true
android:drawable=@drawable/about_btn_pressed /
item android:state_focused=true android:state_enabled=true
android:drawable=@drawable/about_btn_pressed /
item android:state_enabled=true
android:drawable=@drawable/about_btn_normal /
item android:state_focused=true
android:drawable=@drawable/about_btn_normal /
item android:drawable=@drawable/about_btn_normal / 
/selector


* *ImageButton
 android:layout_gravity=center
 android:id=@+id/continue_button
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:adjustViewBounds=true
android:background=#0c3d97 
android:src=@drawable/start_btn

android:onClick=startGame
  /

On Thu, Mar 25, 2010 at 8:56 AM, intbt in...@tacberry.com 
mailto:in...@tacberry.com wrote:


I am getting an error from Eclipse when I use this xml file (res/
drawable/btnswitch.xml) to designate different button conditions

?xml version=1.0 encoding=utf-8?
   selector
xmlns:android=http://schemas.android.com/apk/res/android;
item android:state_pressed=true
  android:drawable=@drawable/btn_st_rd / !-- pressed --
item android:state_focused=true
  android:drawable=@drawable/btn_st_gr / !-- focused --
item android:drawable=@drawable/btn_st_gr / !-- default --
/selector

I call it in my layout file with this code:

   Button
   android:id=@+id/startTimer_btn
   android:src=@drawable/btnswitch
   android:layout_width=wrap_content
   android:layout_height=fill_parent


   /

Eclipse says it can't run the configuration because I have errors but
does not show any errors. And when I remove the xml code (to go back
to my original code which just sets a background image for the Button)
it says that now has errors. I have to restart Eclipse to get the
original code to run again.

Any ideas as to what I am missing?

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

To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com
http://unsubscribegooglegroups.com or reply to this email with
the words REMOVE ME as the subject.




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

Make Call Girl Manager great!
Join the forums.
http://www.fuligin.com/forums
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
 
To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email 
with the words REMOVE ME as the subject.


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [android-developers] Re: Maximum character that we can send to SMS application.

2010-03-24 Thread timo prill

http://en.wikipedia.org/wiki/SMS

[...]  it was necessary to limit the length of the messages to 128 bytes 
(later improved to 140 bytes, or 160 7-bit characters), so that the 
messages could fit into the existing signaling formats[...]


cheers

Bob Kerns schrieb:

It doesn't matter. The first S in SMS stands for 'Short'. Short as in
140 bytes.

Even if you managed to stuff 300 characters (which may be as much as
600 bytes in size) into the SMS app -- it has to either truncate or
give an error.

I think this 140 limit is warping our society in unfortunate ways
(e.g. Twitter), but nonetheless, it's something we just have to deal
with.

On Mar 23, 4:24 am, AJ ajeet.invinci...@gmail.com wrote:
  

Hi Marek,

Thanks for the information. But This I know. I think you misunderstood
my question.

Actually I am invoking SMS application from my app. I am sending some
text [which is around 300 characters] in sms_body. These characters
are being cut when SMS application is being invoked. I could find only
200 characters in the SMS app.

I want to know where is the limitation? Is this a framework
limitation?

I already pasted my code above.
Note: I am sending through Intent.ACTION_SEND

Anyways thanks for being generous and reply
AJ

On Mar 23, 12:13 pm, Marek Pola marek.p...@gmail.com wrote:





A SMS is limited to 140 bytes (octets), maybe this is the boundary you
are experiencing? I don't know if Android supports concatenated SMS.
  
http://en.wikipedia.org/wiki/SMS
  
/Marek
  
On Mar 22, 5:51 pm, AJ ajeet.invinci...@gmail.com wrote:
  

Hi group

I facing one strange problem.

I am sending some text to SMS app as a body. But when the text size

increases more than 200 characters, it cuts the body from there. Only
first 200 characters are appearing in the SMS body. But I can write
more text when SMS gets launched :(

Is there any limitation while sending characters to SMS?

if yes then its ok
But if no then where i am doing wrong?

My code looks like :-

String txt =  characters  more than 200 ;

Intent intent = new Intent(Intent.ACTION_SEND);

intent.setType(text/plain);
intent.putExtra(sms_body, txt);
intent.putExtra(Intent.EXTRA_TEXT, txt);
_activity.startActivity(Intent.createChooser(intent,
_activity.getText(text titte)));

Thanks,

Ajeet Singh



  


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [android-developers] Developing a dictionary

2010-03-23 Thread timo prill

hi,

best way is to use a database to store your data.
have a look at this:
http://developer.android.com/intl/fr/guide/topics/providers/content-providers.html#creating

cheers.


angushir...@googlemail.com schrieb:

Dear all,
   I am currently learning to develop Android applications,
and to do this I have decided to develop a dictionary application. The
UI, and search facilities are no problem to implement, but my question
is, what is the best way to store the entries and definitions for the
dictionary? Would XML be the best approach? I would be looking to
include 500 - 1000 entries.

Thank you for your help

Angus Rose

  


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [android-developers] Proper way of importing contacts to the device/contacts operations are very slow

2010-03-23 Thread timo prill

hi,

which SDK version are you using? 1.5? 1.6? 2.0? 2.1?
there were some changes to the contact api from 1.6 to 2.0...

and maybe give a short snippet of how you insert the contacts to the 
database.
maybe you do some (wrong) very time-consuming database-queries or you 
just missed something, because i have seen my code using the contact db 
implementation run way faster.. even with vcard-parsing  full blown 
contacts...on the htc magic


cheers



cpphool schrieb:

Hi!

I have some questions concerning importing contacts to the device,
which is extremely slow.

First of all, if you delete all your contacts, google sync will
restore it very quickly. However, when my app is adding contacts to
the device, it's very slow (a few contacts per second). Even if I add
almost empty contacts (with name only), it is a time-consuming
process.

If I turn google sync off, importing 5000 contacts can take 1-2 hours
(on HTC Magic). When google sync is on it can take up to 24hours. And
this happens despite the fact, that application for the whole time is
in the foreground, device is connected to charger and screen is on. I
checked the logcat to make sure my app is adding the contacts the
whole time, and it is.

I tried different methods and different devices. The results differ of
course, yet manually adding contacts is always significantly slower
that google sync. Is there any way that I can speed up the process? So
that importing 5000 contacts will take less than an hour.

  


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [android-developers] Re: Proper way of importing contacts to the device/contacts operations are very slow

2010-03-23 Thread timo prill

hey,

try this. maybe its a faster approach to go directly through the 
ContentResolver instead of using createPersonInMyContactsGroup:


  ContentValues values = new ContentValues();
  Uri uri;
  String id;
  ContentResolver cr = getContentResolver ();
  for (int i = 0; i  100; i++) {
   values.clear();
   values.put(People.NAME, Test + i);
   uri = cr.insert(People.CONTENT_URI, values);
   id = uri.getLastPathSegment();
   People.addToMyContactsGroup(cr, Long.parseLong(id));
  }

cheers.

cpphool schrieb:

Hi!

Currently, I'm using HTC Magic (1.5) and Acer Liquid (1.6) to test the
app.

my sample code snippet for API  2.0:

for (int i = 0; i  100; i++) {
Log.d(TAG,iteracja  + i);
ContentValues personValues = new ContentValues();
personValues.put(Contacts.People.NAME, Test + i);
personValues.put(Contacts.People.STARRED, 0);
Uri newPersonUri =
Contacts.People.createPersonInMyContactsGroup(getContentResolver(),
personValues);
}


I did a few tests. Each time I changed NAME String in order to avoid
duplicates.

Results:
1) Acer Liquid (sync off) - 12 sec
2) Acer Liquid (sync on) - 30 sec
3) Acer Liquid (sync on) - 55 sec
4) Acer Liquid (sync on) - 35 sec
5) Acer Liquid (sync off) - 13 sec

1) HTC Magic (sync off) - 27 sec
2) HTC Magic (sync off) - stuck. log from logcat:

ERROR/CursorWindow(13459): need to grow: mSize = 1048576, size = 279,
freeSpace() = 162, numRows = 2789
ERROR/CursorWindow(13459): not growing since there are already 2789
row(s), max size 1048576
ERROR/CursorWindow(13459): The row failed, so back out the new row
accounting from allocRowSlot 2788
ERROR/Cursor(13459): Failed allocating fieldDir at startPos 0 row 2788
DEBUG/Cursor(13459): finish_program_and_get_row_count row 2213

then I turned the sync off and my application started running again
(without restarting the app)! took 30 sec to complete.

Even if we turn off sync on HTC Magic it takes a long time to simply
add empty contacts. Adding 5000 empty contacts (without any other
operations) would take 1500sec = 25min.

On 23 Mar, 11:55, timo prill timo.pr...@googlemail.com wrote:

hi,

which SDK version are you using? 1.5? 1.6? 2.0? 2.1?
there were some changes to the contact api from 1.6 to 2.0...

and maybe give a short snippet of how you insert the contacts to the
database.
maybe you do some (wrong) very time-consuming database-queries or you
just missed something, because i have seen my code using the contact db
implementation run way faster.. even with vcard-parsing  full blown
contacts...on the htc magic

cheers

cpphool schrieb:


Hi!
I have some questions concerning importing contacts to the device,
which is extremely slow.
First of all, if you delete all your contacts, google sync will
restore it very quickly. However, when my app is adding contacts to
the device, it's very slow (a few contacts per second). Even if I add
almost empty contacts (with name only), it is a time-consuming
process.
If I turn google sync off, importing 5000 contacts can take 1-2 hours
(on HTC Magic). When google sync is on it can take up to 24hours. And
this happens despite the fact, that application for the whole time is
in the foreground, device is connected to charger and screen is on. I
checked the logcat to make sure my app is adding the contacts the
whole time, and it is.
I tried different methods and different devices. The results differ of
course, yet manually adding contacts is always significantly slower
that google sync. Is there any way that I can speed up the process? So
that importing 5000 contacts will take less than an hour.




--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[android-developers] Receive Binary SMS on a specific port?

2010-03-18 Thread timo prill

hey there,

is it possible to receive a binary SMS on a specific port?

i am currently receiving SMS via Action: 
android.provider.Telephony.SMS_RECEIVED from a BroadcastReceiver. But 
i have no luck with binary SMS. I only get notified for text messages.


any suggestions?

cheers
timo

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] Update a contact's company title field in Android 1.6

2010-03-12 Thread timo prill

hello,

i am trying to update an addressbook contact's company  title field in 
Android SDK 1.6.


i am trying to update the company field like this:

[...]
values.put(Contacts.Organizations.COMPANY, organisation);
   values.put(Contacts.Organizations.TYPE,
   Contacts.Organizations.TYPE_WORK);

cr.update(Uri.withAppendedPath(uri,String.valueOf(idCompany)), values, 
null,null);


[...]

when executing my code i get the following error:

java.lang.UnsupportedOperationException: Cannot update URL: 
content://contacts/people/13/organizations/6


the way i am trying to update the company field works for all other 
fields (address fields, phone numbers, email addresses etc..). the only 
field where this method does not work is on the company and the title field.


any ideas? is it a known issue in android 1.6? if yes, is there a 
workaround?
even trying to delete the entry and insert a new one instead doesnt 
work. this leads to the same exception when trying to delete the value.


cheers
timo



--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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