Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Eir
Contributor
Posts: 38
Registered: ‎11-28-2011
My Device: Z10
My Carrier: asdf

Contacts API, encoding

Hello BlackBerry,

 

in what way does the BlackBerry runtime for Android retrieve the contacts from the default Contacts app? My app uses a normal ContentProvider, as specified by Android, but the data retrieved is not UTF8 encoded, so I get wrong characters for each entry that is not MS-1251 encoded. On the other hand I see that BlackBerry ported Android code (the Contacts app) displays the same data normally. Are you doing some conversions? What is the BlackBerry recommended way to retrieve this data?

 

Btw, why did you port the Contacts app, wouldn't it be nicer if contacts are open and edited in the native Contacts app?

 

http://eir3.com
Developer
Posts: 16
Registered: ‎01-15-2010
My Device: Z10
My Carrier: Senior Software Engineer

Re: Contacts API, encoding

We are also facing a similar problem with Eir.
We ported our android app with command line tools. We have a contact list in our application. In the resulting blackberry app, we had character encoding problems with Turkish contact names. How can we overcome this problem. Thanks...
Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Contacts API, encoding

Hey there,

 

I'm just curious, which OS are you testing against? If it's 10.1, that was released with the Android Gingerbread runtime, which in general has poor support for special characters.

 

Could you test against a 10.2 build and see if the issue persists?

 

Autoloader Link : http://developer.blackberry.com/devzone/blackberry10devalpha/allautoloaders.html

 

    Justin

 

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Developer
Posts: 16
Registered: ‎01-15-2010
My Device: Z10
My Carrier: Senior Software Engineer

Re: Contacts API, encoding

I updated the device to 10.2 but no way. The problem still persists...
Contributor
Posts: 24
Registered: ‎05-29-2013
My Device: Z10
My Carrier: xxxxx

Re: Contacts API, encoding

Android 2.3 Gingerbread does NOT have poor support for special characters.  I've worked with Android since 1.1 and my app is in 16 different languages and never had a problem with 2.3.  I actually, never had a problem even with 1.6.

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: Contacts API, encoding

If the problem persists, please file a Jira item here: https://www.blackberry.com/jira/secure/Dashboard.jspa

 

Please include a description of the problem and attached sample code/application to reproduce the issue. We'll let the devs investigate further.

 

    Justin

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
Eir
Contributor
Posts: 38
Registered: ‎11-28-2011
My Device: Z10
My Carrier: asdf

Re: Contacts API, encoding

@ jjasmann I'm testing with my Z10 running 10.2.0.1743. I also asked precisely:

 

In what way does the BlackBerry runtime for Android retrieve the contacts from the default Contacts app?

Are you doing some conversions?

What is the BlackBerry recommended way to retrieve this data?

 

I was really hoping for an answer from BlackBerry on any of these questions, since this is a BlackBerry forum, in which BlackBerry is expected to provide help to developers, not an independent developer forum where developers help each other.

 

As you see, I'm not the only one having this problem.

 

But ok, I will file an item as you suggest.

 

@tom_anmoney you are absolutely correct, Android handles encodings perfectly, not only since v.2.3, but since day 0, because it relies on Java, which also handles encodings perfectly since day 0. The simple solution of Java/Android is to use UTF-8 all the way. How come Java folks figured that out in 1997 and BlackBerry does not figure it out in 2013, I don't know, it beats me.

 

So the only way I can see that jjasmann's statement was correct is that it means that the BlackBerry runtime for Android 2.3 handled encodings poorly.

http://eir3.com