using an intent to react when an sms is sent?

by phlogi phlog » Sat, 27 Dec 2008 18:30:16 GMT


Sponsored Links
 Hi there

I'm planning to write some code that allows to send sms over a http service.

So basically I need to achieve that the current messaging application calls
a
function from my class of my appliction. Then I need to get the text and
establish a connection and so on. Furthermore I need to be able to exit my
app
if there is no internet connection - in such a case the sms should be sent
using the normal method.

For me developing on android is totally new. (I'm now at ex2 of the notepad
tutorial, and read the basic docs).

So how can I do what I would like to? Maybe someone can help me with the
basics: Lets say that a popUp is generated when an sms is sent. Will I use
an
Indent on the method of sendTextMessage ?

Thanks a lot for your help.

Cyrill Helg

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



Other Threads

1. RelativeLayout is displaying contained TextViews overlapped

Hello,
I am trying to display two TextViews in two separate line. For that, I
am using RelativeLayout. I don't want to use XML for layout as I want
to bundle this Activity in a jar file which may be used by different
APKs.

The TextViews are being overlapped instead of being displayed on two
separate lines. Any idea what I am doing wrong here? Sample code is
below.

package test.RL;

import android.app.Activity;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class RelativeLayoutDemo extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        doMyLayout();
    }

    protected void doMyLayout() {
        RelativeLayout topLayout = new
RelativeLayout(getApplicationContext());
        TextView title = new TextView(getApplicationContext());
        TextView prompt = new TextView(getApplicationContext());
        title.setText("My title goes here");
        RelativeLayout.LayoutParams titleParams = new
RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
        titleParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        titleParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        titleParams.addRule(RelativeLayout.ABOVE, prompt.getId());
        topLayout.addView(title, titleParams);

        prompt.setText("My prompt goes here too");
        RelativeLayout.LayoutParams promptParams = new
RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
        promptParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
        promptParams.addRule(RelativeLayout.BELOW, title.getId());

        topLayout.addView(prompt, promptParams);
        setContentView(topLayout);
    }
}

-- 

2. Strange RelativeLayout Behaviour - Layout Bug?

Hi there,

I'm using setMargines function to specify control the UI view
position.
For some reason, only when specifying a specific margin range the UI
control view gets totally disordered.
Other values seems to work just fine... the disorders of the control
are when:
width = 50; width=50; x = (180 to 130) ; y =181; (below code for more
information)

I'm using emulator in HVGA mode Android 2.1(level 7).
Using the following I get disordered UI. Any help will be highly
appreciated!

public void onCreate(Bundle savedInstanceState)
{
       super.onCreate(savedInstanceState);
       int x,y,width,height;
       width = 50; height=50;  x = 160; y =181;
       RelativeLayout  relativeLayout =  new
RelativeLayout(getBaseContext());
       Button btn = new Button( getBaseContext() );
       btn.setVisibility(View.VISIBLE);
       Rect rect = new Rect(x,y,x+width,y+height);
       LayoutParams layoutParam = new LayoutParams(rect.width(),
rect.height());
       layoutParam.setMargins( rect.left, rect.top, rect.right,
rect.bottom );
       btn.setLayoutParams( (ViewGroup.LayoutParams)layoutParam);
       relativeLayout.addView(btn);
       this.setContentView(relativeLayout);
}

-- 

3. Activity lifecycle difference between device and emulator

4. How to track URL in each landing page in Webview

5. URGENT....REQ............Android

6. HTML5 video support

7. Android logo copyright/trademark