Android has an SMS API but for this app (at least this release, I may change my mind in the future), I decided to just pawn off the SMS request to the default SMS app. This allows more transparency to the users about stuff that would cost them money, i.e. sending texts. I imagine it should be possible to do the same on the iPhone - trigger the default sms app to handle sending a message, no?
- Deepak Sarda
Ah ok. It's kinda half-baked on the iPhone right now. You can delegate to the official SMS app, but you can't pre-populate the body of the SMS, just the recipient list. (However you can do so for email so its kinda weird). I try to work around it like this: http://mclov.in/2009...
- arunthampi
Don't have an Android myself but my brother does, so will be sure to tell him about Cabbie :)
- arunthampi
That's just ridiculous. This is how I do it in Android. Bonus - this works no matter what SMS app the user chooses as their preferred app! Intent i = new Intent(Intent.ACTION_VIEW); i.setType("vnd.android-dir/mms-sms"); i.putExtra("address", PHONE_NUM); i.putExtra("sms_body", BODY); i.putExtra("exit_on_sent", true); startActivity(i);
- Deepak Sarda
Cool. Yeah I'd prefer in-app SMS's because then I don't have to quit the app, but the solution you've proposed works great too.
- arunthampi
You see that 'exit_on_sent' attrib? As soon as the sms is sent in the sms app, that app exits & the user is taken back to your app. In Android terms, the task stack gets unwound! The experience is as-if the sms sending is just another screen in your app. One of the best conceptual things about Android is this idea of merging activities from different apps to create what appears to the user to be a single 'traditional app'.
- Deepak Sarda
from email
Someday, I will have an Android phone and this app will be on it, even if I almost never use cabs :)
- Balaji Dutt
@balaji: to tell you the truth, I rarely book cabs. And I haven't booked one yet with Cabbie! But I thought this idea was big enough & interesting enough to be a great intro to Android programming project
- Deepak Sarda
just tried it out - it uses the same method that I use in my app. Copies to clipboard and then the user has to manually paste in the sms compose textfield.
- arunthampi
A very long time! wxWidgets and GTK really aren't designed with a touch interface in mind. The Qt folks are making lots of progress with Qt and you'll see that in the next Maemo release. But Qt will (most likely) never be officially part of Android. As a third-party add-on, it'll be a PITA to implement given that Qt is C++ and the sandbox restrictions on the NDK.
- Deepak Sarda
My Motorola E6 (touch screen) UI is Qt and the phone runs Linux. And it is such an old phone already. I hope they port some mainstream UI toolkit over to Android. Android is aiming for larger-screen devices (like ebook readers & netbooks) anyway, so it makes sense not to restrict itself to esoteric UIs.
- Ashwin Nanjappa
Is there any Apache/BSD licensed mainstream UI toolkit out there?
- Deepak Sarda
from email
Damn, I totally forgot about Mono! Surely Mono/.Net will be there on Android soon! :-)
- Ashwin Nanjappa
We'll see how well Mono on iPhone does before clamoring for Mono on Android :) On the other hand, if you are willing to code in C#, why not just stick to Java?
- Deepak Sarda
from email