reading and writing sms programmatically

by jsm_rajesh » Wed, 14 May 2008 10:37:03 GMT

Sponsored Links

This is Rajesh, i just want to know can we read and write sms
programmatically  using Android.
Thanks in advance

Other Threads

1. Debugging a separate thread.

I am getting familiar with debugging from eclipse.
I have a thread that runs in the background, and set
a breakpoint in that file.  When I debug my program,
I never see it stop there or display the file that
the break is in.  Do I need to do something special
in order to select which thread I'm debugging?

Also, as I step through my program, I eventually
get to parts of the Android system, where I'm in
the dark.  I get a message about the source file
not being available which makes sense.  I just
keep hitting F7, and eventually get back to my
code.  Is this a normal routine that people go
through, and can I get and install the source
somewhere so that I could actually step through
the Android code?




2. Click event on Edit-Text's Right Drawable.

Hello Developers,

I have one Edit Text with right drawable.
The xml code is

<TextView android:id="@+id/trip_txt_to"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="@string/addname" android:layout_alignParentLeft="true"
android:textStyle="bold" android:textColor="@color/black"
android:typeface="normal" android:padding="10dp"
android:layout_below="@+id/lineview1" />

android:id="@+id/nameofpersonr" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/name" android:textColor="@color/black"

<ImageView android:id="@+id/clearnameimage"
android:layout_alignParentRight="true" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:scaleType="fitXY"
android:src="@drawable/deleteicon" android:padding="5dp"/>


public class CustomEditTextActivity extends EditText {
private Drawable rightSideDrawable;
private Rect rectangleBounds;

public CustomEditTextActivity(Context context, AttributeSet attributeSet,
int defStyle) {

super(context, attributeSet, defStyle);

public CustomEditTextActivity(Context context, AttributeSet attributeSet) {
super(context, attributeSet);

public CustomEditTextActivity(Context context) {

public void setCompoundDrawables(Drawable left, Drawable top,
Drawable right, Drawable bottom) {
if (right != null) {
rightSideDrawable = right;
super.setCompoundDrawables(left, top, right, bottom);

protected void finalize() throws Throwable {
rightSideDrawable = null;
rectangleBounds = null;

public Rect getRectBound() {
return rectangleBounds;

public Drawable getRightDrawable() {
return rightSideDrawable;
          // on touch event code i got from some site..
    public boolean onTouchEvent(MotionEvent event)

        if(event.getAction() == MotionEvent.ACTION_UP &&
         rectangleBounds = rightSideDrawable.getBounds();
            final int x = (int)event.getX();
            final int y = (int)event.getY();

            if(x>=(this.getRight()-rectangleBounds.width()) &&
                    && y>=this.getPaddingTop() &&
                event.setAction(MotionEvent.ACTION_CANCEL);//use this to
prevent the keyboard from coming up
        return super.onTouchEvent(event);


Now problem is,

when i open the activity, it shows me keyboard and i can right in edit text,
but as soon as i touch to edit text it launches another activity, i called
it "". But is supposed to be launched if
I click on drawable not on edit text.
Can you please help me to get click event or touch event on right hand side
drawable, instead of edit text? or is there any other alternative way?
Also, because of this i can not use this line for keyboard..


Can anyone help me in that? I have made lots of changes in ontouch event
written above but fail.

So please help me in that. I really appreciate it. Thank you in advance.


3. Layout related

4. Syntax to reference a drawable from a library project

5. monkeyrunner with different android versions

6. DalvikVm issue

7. ASK : signal motorola xt720 sering hilang