Country code from Location API

by mboehmer » Thu, 19 May 2011 17:30:18 GMT


Sponsored Links
 Is it possible to get a country code for the user's current location from 
the location API? Or from somewhere else?

-- 



Re: Country code from Location API

by gaurav gupta » Thu, 19 May 2011 18:42:14 GMT


 Hi , i can provide u api for finding country name and city name using
longitute and latitute.
in this api u can get country code too.
its api is mainly for weather report but u can use it, here a tag
<country>IN</country> gives country code.
i hope it will work for u


 http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=28.6484223 ,77.1265769



<country>IN</country>

</country_iso3166>
chk these tags of this api.it will work 4 u.
u just change longitute and latitute in this url u will get the anycountry's
code;
:)





-- 


Sponsored Links


Re: Country code from Location API

by Matthias B枚hmer » Thu, 19 May 2011 18:52:20 GMT


 Hi, thanks! There are a lot of web services that provide country codes. But I 
would rather like to do it offline, directly on the device. Is there any 
possibility to get the country code from any API directly on the device?

Am 19.05.2011 um 12:41 schrieb gaurav gupta:



-- 



Re: Country code from Location API

by gaurav gupta » Thu, 19 May 2011 18:56:36 GMT


 HI,
cant understand ur requirement. please explain,
if u want to use without any interaction of internet. then u have to make it
static and add all the list in ur String.xml
 http://code.google.com/apis/adwords/docs/appendix/countrycodes.html 
please explain ur requirement.den anyone can help u.

2011/5/19 Matthias Bhmer <matboeh...@googlemail.com>



-- 



Other Threads

1. Android paid apps in Ireland

Hi guys

I have a popular music search engine app for the iPhone called Tunepal
(http://www.youtube.com/watch?v=Gr0xnlYZ_gM) and in response to
multiple requests I have been working hard to port it Android. The
port will be finished in the coming weeks and I want to sell it on the
Android Marketplace. The majority of my iPhone users are in Ireland
(though I have users in 22 countries). I am not going to release it
for free. It seems I cant sign up for a google checkout merchant
account, because I live in Ireland and there are no paid apps allowed
on the Irish Android Marketplace!!!

The first problem I can get around by using my sisters bank account in
London (why??) but how do I get around the second problem?

1. When will the Android paid app marketplace be available in Ireland
2. If its not going to be for a while, how do I sell my app in Ireland
withough using the Android Marketplace?

Thanks

Bryan

-- 

2. send MMS with Audio part via Intent

Hello,
I have a problem in my application. I have to send MMS with audio
attachement.

If I do :

public void sendMMS(Context aContext, String aFilePath) {
                Intent intent = new Intent("android.intent.action.SEND_MSG");

                intent.putExtra("address", "aphonenumber");
                intent.putExtra("sms_body", "mybody");

                Uri uri = Uri.fromFile(new File("/sdcard/myimage.jpg"));
                intent.putExtra(Intent.EXTRA_STREAM, uri); // imageUri set
previously
                intent.setType("image/jpeg");

                aContext.startActivity(intent);

}

It's work great. I can preview my MMS with an image in attachement.

But if I put audio file in attachement :

public void sendMMS(Context aContext, String aFilePath) {
                Intent intent = new Intent("android.intent.action.SEND_MSG");

                intent.putExtra("address", "aphonenumber");
                intent.putExtra("sms_body", "mybody");
                Uri uri = Uri.fromFile(new File("/sdcard/audiofile.amr"));
                intent.putExtra(Intent.EXTRA_STREAM, uri); // imageUri set
previously
                intent.setType("audio/amr");

                aContext.startActivity(intent);
}

It's didn't work...

I have a nice exception :

06-17 11:29:44.608: DEBUG/ComposeMessageActivity(3881):
initActivityState: null, Intent { act=android.intent.action.SEND_MSG
typ=audio/amr cmp=com.android.mms/.ui.ComposeMessageActivity (has
extras) }
06-17 11:29:44.648: VERBOSE/MmsProvider(139): Delete uri=content://mms/
9223372036854775807/part, match=11
06-17 11:29:44.738: DEBUG/dalvikvm(3881): GC freed 1436 objects /
118040 bytes in 80ms
06-17 11:29:44.848: VERBOSE/MessageTextEditor(3881): Nli: -1
06-17 11:29:44.858: DEBUG/Jerry(3881): new mMessageBodyEditor
06-17 11:29:44.978: VERBOSE/ComposeMessageActivity(3881): onCreate():
savedInstanceState = null
06-17 11:29:44.978: VERBOSE/ComposeMessageActivity(3881): onCreate():
intent = Intent { act=android.intent.action.SEND_MSG typ=audio/amr
cmp=com.android.mms/.ui.ComposeMessageActivity (has extras) }
06-17 11:29:44.978: VERBOSE/ComposeMessageActivity(3881): onCreate():
mThreadId = 0
06-17 11:29:44.978: VERBOSE/ComposeMessageActivity(3881): onCreate():
mMessageUri = null
06-17 11:29:44.978: DEBUG/ComposeMessageActivity(3881): initFocus:
true
06-17 11:29:45.008: DEBUG/ComposeMessageActivity(3881):
-----------------mMessageUri:null

06-17 11:29:45.218: ERROR/AndroidRuntime(3881):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.android.mms/
com.android.mms.ui.ComposeMessageActivity}:
java.lang.NullPointerException
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2464)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2486)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread.access$2100(ActivityThread.java:123)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1843)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.os.Handler.dispatchMessage(Handler.java:99)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.os.Looper.loop(Looper.java:123)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread.main(ActivityThread.java:4321)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
java.lang.reflect.Method.invokeNative(Native Method)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
java.lang.reflect.Method.invoke(Method.java:521)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
dalvik.system.NativeStart.main(Native Method)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881): Caused by:
java.lang.NullPointerException
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.content.ContentResolver.acquireProvider(ContentResolver.java:
574)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.content.ContentResolver.query(ContentResolver.java:147)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.google.android.mms.util.SqliteWrapper.query(SqliteWrapper.java:
209)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.model.MediaModel.initAudioForDRM(MediaModel.java:361)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.model.MediaModel.<init>(MediaModel.java:86)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.model.AudioModel.<init>(AudioModel.java:58)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.model.AudioModel.<init>(AudioModel.java:52)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.ui.MediaPicker.makeNewAudio(MediaPicker.java:257)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.ui.MediaPicker.onMediaPicked(MediaPicker.java:346)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.ui.ComposeMessageActivity.handleSendIntent(ComposeMessageActivity.java:
4023)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java:
2807)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2418)
06-17 11:29:45.218: ERROR/AndroidRuntime(3881):     ... 11 more


Anyone have an idea to fix this problem ?

-- 

3. SQLiteOpenHelper.getWritableDatabase ambiguous documentation

4. "back" button when in ListActivity causes runtime exception

5. Adding an Intent to a Sync'd account option in a contact

6. Recieveing a notification when an activity is launched

7. chrome