Dial a USSD code

by sabdart » Fri, 23 Jan 2009 16:44:39 GMT


Sponsored Links
 Hi,

When I dial a divert number directly from the handset it works.
For example: **004*+668190099# sets up my call forwarding to the
number +668190099

However, when I try to do the same thing from within an application I
get a problem. The number displayed in the dialer is missing the
ending #.

E.g.
startActivity(new Intent("android.intent.action.DIAL",
                Uri.parse("tel:**004*+668190099#")));

displays **004*+668190099 in the dialer.

The log shows:
I/ActivityManager(   56): Starting activity: Intent
{ action=android.intent.action.DIAL data=tel:**004*+668190099# comp=
{com.android.contacts/com.android.contacts.DialtactsActivity} }

Is this a bug or is there some other reason it wont let me dial a ussd
code?

Cheers
Ray
--~--~---------~--~----~------------~-------~--~----~



Dial a USSD code

by sabdart » Thu, 29 Jan 2009 15:41:16 GMT


 Not a bug and it is in the documentation ( http://code.google.com/ 
android/reference/android/net/Uri.html)
I should have been escaping the # symbol with %23

String encodedHash = Uri.encode("#");

startActivity(new Intent("android.intent.action.DIAL",
     Uri.parse("tel:**004*+668190099" + encodedHash)));

Note to self: RTFM
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Dial a USSD code

by droi...@gmail.com » Tue, 03 Mar 2009 07:29:39 GMT


 Does the Android API provide a way to catch the USSD response after
the dial?

thanks



--~--~---------~--~----~------------~-------~--~----~



Dial a USSD code

by Ray » Tue, 10 Mar 2009 18:44:35 GMT


 I expected to see the response by using startActivityForResult and
onActivityResult(int requestCode, int resultCode, Intent data)

But that didn't work for me and I've run out of ideas.

Ray




--~--~---------~--~----~------------~-------~--~----~



Dial a USSD code

by Ray » Thu, 12 Mar 2009 16:07:31 GMT


 saying that... I have been testing on a network other than Tmobile...
If anyone reading this in the US on Tmobile tries this, please post
the results. You will need to change the USSD code to one that is
valid for Tmobile, one that returns the handset mobile number would be
a good choice.

Also enable calling in the manifest and create a TextView called
sometext.

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        String encodedHash = Uri.encode("#");

        view = (TextView) findViewById(R.id.sometext);
        call("*121" + encodedHash);
    }


    protected void call(String phoneNumber) {
        startActivityForResult(new Intent("android.intent.action.CALL",
                       Uri.parse("tel:" + phoneNumber)), 1);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
        view.setText("USSD: " + requestCode + " " + resultCode + " " +
data);
    }






--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Issues with Playing 2 videos using HTML5 Video Element in Android

Hi All,

I haven't received any responses for a long time. Does anybody know a
solution for this issue?

----
Darshan





-- 

2. passing surface to native is giving sigsegv error

Hi
I am porting one application in android2.1 eclair version .I need to
pass surface to native code
when i am doing this i am getting following error
signal 11 (SIGSEGV), fault addr deadbaad
I/DEBUG   ( 2175):  r0 00000000  r1 afe13389  r2 00000027  r3 00000054
I/DEBUG   ( 2175):  r4 afe3ae08  r5 00000000  r6 00000000  r7 ffff21b3
I/DEBUG   ( 2175):  r8 bea48930  r9 430cb3a4  10 430cb38c  fp 00000000
I/DEBUG   ( 2175):  ip 00002ee0  sp bea488e0  lr deadbaad  pc
afe10a40  cpsr 68000030
I/DEBUG   ( 2175):          #00  pc 00010a40  /system/lib/libc.so
I/DEBUG   ( 2175):          #01  pc 00007a9a  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):          #02  pc 0000ecb4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #03  pc 00038890  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #04  pc 000319dc  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #05  pc 000139b8  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #06  pc 00019338  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #07  pc 00018804  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #08  pc 0004ea7a  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #09  pc 00056c98  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #10  pc 000139b8  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #11  pc 00019338  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #12  pc 00018804  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #13  pc 0004eda4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #14  pc 0003ae9a  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #15  pc 0002bea4  /system/lib/libdvm.so
I/DEBUG   ( 2175):          #16  pc 0002a448  /system/lib/
libandroid_runtime.so
I/DEBUG   ( 2175):          #17  pc 0002bbdc  /system/lib/
libandroid_runtime.so
I/DEBUG   ( 2175):          #18  pc 00008cd8  /system/bin/app_process
I/DEBUG   ( 2175):          #19  pc 0000c258  /system/lib/libc.so
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): code around pc:
I/DEBUG   ( 2175): afe10a30 f8442001 4798000c e054f8df 26002227
I/DEBUG   ( 2175): afe10a40 2000f88e ef34f7fb f7fd2106 f04fe822
I/DEBUG   ( 2175): afe10a50 91035180 460aa901 96012006 f7fc9602
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): code around lr:
I/DEBUG   ( 2175): deadba9c ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175): deadbaac ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175): deadbabc ffffffff ffffffff ffffffff ffffffff
I/DEBUG   ( 2175):
I/DEBUG   ( 2175): stack:
I/DEBUG   ( 2175):     bea488a0  00000015
I/DEBUG   ( 2175):     bea488a4  afe133b9  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488a8  afe3b02c  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488ac  afe3afd8  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488b0  00000000
I/DEBUG   ( 2175):     bea488b4  afe143d3  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488b8  afe13389  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488bc  afe13389  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488c0  00000054
I/DEBUG   ( 2175):     bea488c4  afe3ae08  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488c8  00000000
I/DEBUG   ( 2175):     bea488cc  bea488f4  [stack]
I/DEBUG   ( 2175):     bea488d0  ffff21b3
I/DEBUG   ( 2175):     bea488d4  afe1362b  /system/lib/libc.so
I/DEBUG   ( 2175):     bea488d8  df002777
I/DEBUG   ( 2175):     bea488dc  e3a070ad
I/DEBUG   ( 2175): #00 bea488e0  485b61a0  /dev/ashmem/mspace/dalvik-
heap/2 (deleted)
I/DEBUG   ( 2175):     bea488e4  f36ff619
I/DEBUG   ( 2175):     bea488e8  001274d8  [heap]
I/DEBUG   ( 2175):     bea488ec  ffff2159
I/DEBUG   ( 2175):     bea488f0  8194f4b0  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea488f4  fffffbdf
I/DEBUG   ( 2175):     bea488f8  ffff2159
I/DEBUG   ( 2175):     bea488fc  8194f4b0  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea48900  ffff2225
I/DEBUG   ( 2175):     bea48904  81907a9d  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175): #01 bea48908  485b61a0  /dev/ashmem/mspace/dalvik-
heap/2 (deleted)
I/DEBUG   ( 2175):     bea4890c  819414e8  /data/data/
com.android.dreamshot/lib/libdreamshot.so
I/DEBUG   ( 2175):     bea48910  43355928  /dev/ashmem/dalvik-
LinearAlloc (deleted)
I/DEBUG   ( 2175):     bea48914  001274d8  [heap]
I/DEBUG   ( 2175):     bea48918  00000340
I/DEBUG   ( 2175):     bea4891c  bea48950  [stack]
I/DEBUG   ( 2175):     bea48920  00000000
I/DEBUG   ( 2175):     bea48924  00000000
I/DEBUG   ( 2175):     bea48928  430cb3ac
I/DEBUG   ( 2175):     bea4892c  ad00ecb8  /system/lib/libdvm.so
D/Zygote  ( 2183): Process 2700 terminated by signal (11)
I/WindowManager( 2222): WIN DEATH: Window{4865c520
com.android.dreamshot/com.android.dreamshot.DSMainActivity
paused=false}
I/ActivityManager( 2222): Process com.android.dreamshot (pid 2700) has
died.
I/WindowManager( 2222): WIN DEATH: Window{485f0f08
com.android.dreamshot/com.android.dreamshot.DreamShotUi paused=false}
I/WindowManager( 2222): WIN DEATH: Window{48637008 SurfaceView
paused=false}
I/ActivityManager( 2222): Start proc com.android.dreamshot for
activity com.android.dreamshot/.DreamShotUi: pid=2707 uid=10085
gids={1006}
I/UsageStats( 2222): Unexpected resume of com.android.dreamshot while
already resumed in com.android.dreamshot
D/dalvikvm( 2707): GC freed 954 objects / 71008 bytes in 26ms
W/InputManagerService( 2222): Got RemoteException sending
setActive(false) notification to pid 2700 uid 10085
I/ActivityManager( 2222): Displayed activity
com.android.dreamshot/.DreamShotUi: 338 ms (total 1360 ms)
I/KeyInputQueue( 2222): Input event: dev=0x0 type=0x1 scancode=28
keycode=4 value=1
I/PowerManagerService( 2222): ULight 3->7 f0



my code looks like this
in java .xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"

android:layout_width="fill_parent"
android:layout_height="fill_parent">

<SurfaceView android:id="@+id/mySurfaceView"

android:layout_width="fill_parent"
android:layout_height="fill_parent">

</SurfaceView>

</LinearLayout>

in .java
mSurfaceView =(SurfaceView)findViewById(R.id.mySurfaceView);
  mSurfaceHolder = mSurfaceView.getHolder();
  mSurfaceHolder.addCallback(this);
  mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

 public void surfaceChanged(SurfaceHolder holder, int format, int
width,
                          int height) {

                 if (holder.getSurface() == null) {
                  Log.d(TAG, "holder.getSurface() == null");

              }

              mSurfaceHolder = holder;
                   if(holder.isCreating())
              {

                 nativeDS.setPreviewSurface(holder.getSurface());

              }
my jni looks like this
static  void JNICALL
Java_com_android_dreamshot_DreamShot_setdsPreviewSurfaceNative(JNIEnv
*env, jobject object, jobject surface)
{
        if (surface != NULL) {
                 jclass clazz = env->FindClass("android/view/Surface");
                 LOGE("clazz=%d", clazz);
            if (clazz == NULL) {

                return ;
            }

            jfieldID fieldID = env->GetFieldID(clazz, "mSurface", "I");
                LOGE(" ...............fieldID is in native class %d", fieldID);

            if (fieldID == NULL) {
             LOGE(".................Can't find Surface
fields...................................................");
                return;
            }


    const sp<Surface>& native_surface=(Surface*)env-


        LOGE("objPreviewplayer=%p", objPreviewplayer);
        const sp<ISurface>& surface1 =
objPreviewplayer.getISurface(native_surface) ;
//      const sp<ISurface>& surface1 =NULL;
         LOGE("surface1=%p", surface1);
         // LOGE("native_surface=%d", native_surface);
         setdsPreviewSurface(surface1);

        }
}

I am getting error inside this function
what are all the system libs i should include in the makefile


i  got stuck up in this from past one week please help me out

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. AutoCompleteTextView and Ajax-like request

4. Reducing Permissions

5. How do i switch to new activity from a custom listview ?

6. Creating and using a 鈥渃om mon platform鈥?jar in Android - what works?

7. EditText field not update, how to do this?