Switch case on String

by Abhi » Thu, 24 Sep 2009 22:57:18 GMT

Sponsored Links
 Can I do a switch(String), case (compare with other string) and how?

I am trying to compare string results and perform actions...



Switch case on String

by Felipe Silveira » Fri, 25 Sep 2009 00:50:59 GMT

 No, you can't.

In Java we don't have switch with Strings.


Felipe Silveira

Felipe Silveira
Engenharia da Computao
Universidade Federal de Itajub
MSN: felipeuni...@hotmail.com
Skype: fsunifei


Sponsored Links

Switch case on String

by Abhi » Fri, 25 Sep 2009 01:07:52 GMT

 Ok. Thanks Felipe. I just figured that out.




Other Threads

1. WAP Push not working

I am trying to get WAP push working. When I send the push message to
the device I see this in the LogCat

06-18 17:19:13.762: DEBUG/dalvikvm(148): GC freed 702 objects / 61496
bytes in 130ms
06-18 17:19:18.792: DEBUG/dalvikvm(143): GC freed 369 objects / 16696
bytes in 152ms
06-18 17:19:25.422: DEBUG/SmsProvider(119): insert url=content://sms/
raw, match=15
06-18 17:19:31.842: DEBUG/WAP PUSH(119): Rx:
06-18 17:19:33.312: INFO/MyFaves(143): starting service with intent:
Intent { flags=0x4 comp={com.tmobile.myfaves/
com.tmobile.myfaves.MyFavesService} (has extras) }
06-18 17:19:33.312: INFO/MyFaves(143): handleMessage(0)
06-18 17:19:33.352: INFO/MyFaves(143): sending msg:
to 32837
06-18 17:19:33.472: INFO/ActivityManager(64): Stopping service:

I have the intent set up and the permission, but the my code is never
called (this works for SMS - so most of the code is right I assume).
Here is the manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.mformation.gStub" android:versionCode="1"
        <application android:icon="@drawable/icon" android:label="@string/
                <activity android:name=".Engine" 
android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />

                <receiver android:name="BootReceiver">
android:name="android.intent.action.BOOT_COMPLETED" />
android:name="android.intent.category.HOME" />

                <receiver android:name="SMSReceiver">
android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
android:name="android.provider.Telephony.SMS_RECEIVED" />
                        <action android:name="android.Telephony"></action>

android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
android:name="android.permission.ACCESS_COARSE_LOCATION" />
        <uses-permission android:name="android.permission.READ_PHONE_STATE" /
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.RECEIVE_SMS" />
        <uses-permission android:name="android.permission.INSTALL_PACKAGES" /
        <uses-permission android:name="android.permission.READ_SMS" />
        <uses-permission android:name="android.permission.RECEIVE_MMS" />
        <uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" /

Now this particular message type works in several other types of
device (Symbian and Windows mobile), so I am quite sure the content is

I have tried platform 1.5 and 1.1. The hardware I am using is an HTC

Should this work?
If so, any ideas what I can investigate?

One other question - is there any way to stop the continual "myfaves"
SMS? No idea how much that is consting me. I am not using a T-Mobile



2. Re : Re : Sharing data between an Android service and an application.

If you only need to provide some parameters at startup, you can do
that in the onbind intent. If you don't need tight coupling between
activity and service and the amount of data is very limited, you can
use sharedpreferences to exchange data.


3. Update widget from code

4. Re : Sharing data between an Android service and an application.

5. Android boot hangs at splash screen

6. Performance depending on size of SDRAM?

7. wma and wmv format supportence in android mobile