How to Read Incoming SMS and Send SMS in an Android Application

by Shaz » Tue, 13 May 2008 14:22:24 GMT


Sponsored Links
 HI,

I want to how I can read incoming SMS and send SMS by using the
Android application framework??

Thanks,
Shaz
--~--~---------~--~----~------------~-------~--~----~



How to Read Incoming SMS and Send SMS in an Android Application

by Zach Hobbs » Wed, 14 May 2008 01:07:28 GMT


 There is an SMS example here:
 http://www.helloandroid.com/node/159 

-- 

Zach Hobbs
HelloAndroid.com
Android OS news, tutorials, downloads 






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


Sponsored Links


How to Read Incoming SMS and Send SMS in an Android Application

by Shaz » Wed, 14 May 2008 06:38:18 GMT


 Thanks Zach
--~--~---------~--~----~------------~-------~--~----~



How to Read Incoming SMS and Send SMS in an Android Application

by Andr茅s Vargas Gonz谩lez » Wed, 14 May 2008 18:46:47 GMT


 fantastic link thanks a lot!!!

-----BEGIN GEEK CODE BLOCK-----
  Version: 22.10.89
  GE/M/CS s+:+ a--- C+++ UL++ P L+ E--- W+ N* o+++ K- 
  w O-- M- V++ PS Y PGP--- t-- 5 X++++ R-- tv+ b DI- 
  D G+++ e++ h--/! r- z--
------END GEEK CODE BLOCK------



_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
 http://spaces.live.com/spacesapi.aspx?wx_action=create& ;wx_url=/friends.aspx&mkt=en-us
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Problem with dynamically adding layouts

I have a problem and I'm not sure it's my problem or bug in the
framework. I have a screen that's filled with couple of layouts that
have some ShapeDrawable set as background (and I know, I should use
nine-patch images, this is just a test for something different). When
I try to dynamically add more layouts, my shape drawable code goes
nuts and draws borders all around the place. Here is the code, the bug
manifests mostly when the entire screen is filled with items:

DrawTest.java:
-----------------------------------------

package com.test.DrawTest;

import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.Shape;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class DrawTest extends Activity {
        private int _counter = 1001;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        View title = findViewById(R.id.titleContainer);
        title.setBackgroundDrawable( new ShapeDrawable( new SimpleRect
( Color.DKGRAY, Color.WHITE ) ) );

        Button b = (Button)findViewById(R.id.addButton);
        b.setOnClickListener( new OnClickListener() {
                        @Override public void onClick(View v) {
                                DrawTest.this.AddNewTask();
                        }
        });
    }

    protected void AddNewTask() {
        ViewGroup content = (ViewGroup)findViewById(R.id.content);

        LinearLayout item = (LinearLayout)LayoutInflater.from
(this).inflate(R.layout.item, content, false);
        item.setBackgroundDrawable( new ShapeDrawable( new SimpleRect
( Color.rgb(0, 96, 0), Color.WHITE ) ) );
        TextView txt = (TextView)item.findViewById(R.id.item_title);
        txt.setText( "Test " + _counter );
                content.addView( item );
                _counter++;
        }

        public static class SimpleRect extends Shape {
        private Paint _fillPaint, _borderPaint;

        public SimpleRect( int fillColor, int borderColor ) {
                _fillPaint = new Paint();
                _fillPaint.setColor( fillColor );
                _fillPaint.setStyle(Paint.Style.FILL);

                _borderPaint = new Paint();
                _borderPaint.setColor(borderColor);
                _borderPaint.setStyle(Paint.Style.STROKE);
                _borderPaint.setStrokeWidth(3);
        }

                @Override
                public void draw(Canvas canvas, Paint paint) {
                        RectF rc = new RectF( canvas.getClipBounds() );
                        rc.inset(2, 2);
                        Log.v("Draw", rc.toString());
                        canvas.drawRoundRect(rc, 4, 4, _fillPaint);
                        canvas.drawRoundRect(rc, 4, 4, _borderPaint);
                }
    }
}

---------------------

main.xml:
---------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/titleContainer"
        android:padding="10dp"
        android:orientation="horizontal">

        <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:paddingRight="6dp"
             android:text="Hello, world"
             android:id="@+id/item_title" />

        <EditText
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               android:id="@+id/title_edit"/>
    </LinearLayout>

    <ScrollView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1">

            <LinearLayout
                android:orientation="vertical"
                android:id="@+id/content"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

   </ScrollView>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="30dp"
        android:paddingRight="30dp">

        <Button
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:id="@+id/addButton"
             android:text="Add content"
             android:textSize="14sp"
             android:padding="10dp" />
   </LinearLayout>
</LinearLayout>
------------------------------

item.xml:
------------------------------
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/item_container"
    android:layout_margin="8dp">
    >
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/item_title"
        android:padding="10dp"
        android:textSize="14sp" />
</LinearLayout>
-----------------------------

Interesting thing is - when the EditText is commented out, everything
seems to works fine. Also, just looking at the LogCat output it's
seems that drawable redraw is called every time when the cursor in the
EditText blinks.

Any ideas?

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

2. Loading DEX files at runtime from SDCARD - Possible?

Hey!

BACKGROUND

I would like my users to develop their own routines for image
manipulation. Lets presume that a third party has written a class
which implements one of my interfaces;

public abstract class PixelBinaryFilter extends BinaryFilter{
                 ...
        protected abstract int generatePixel(int p1, int p2);
                 ...
}

And hence has a class with one method defined, which could multiply
pixel values together, subtract them find their lowest common multiple
basically any routine they can think of.

This class would be complied and then converted to DEX using the dx
tool.

The third party would then download the .dex file to their phones
SDCARD, probably via my application using a 'Get New Routines' request
which takes the URL of the file.

QUESTION

If I have a .dex file on the SDCARD how can I load it at runtime? The
class name and path would be known.

I have been using the Class.forName command for the standard routines
but I don't know how (if) this will work with classes outside of the
application.

Many thanks,

Gavin

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

3. Bluetooth enabling

4. ADP1 shipping time to India

5. How to convert base64string to Image?

6. Any news on Google-proprietary apps?

7. SENSOR_ORIENTATION - North Reference