andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

Recognize/React on incoming SMS

Goto page Previous  1, 2, 3, 4  Next
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Novice Tutorials
Author Message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1887
Location: Germany

PostPosted: Sun Feb 17, 2008 3:31 pm    Post subject: Reply with quote

Hello puyopuy,

Just saw the reason:
Java:
WARN/ActivityManager(508): Permission Denial: receiving Intent { action=android.provider.Telephony.SMS_RECEIVED extras=Bundle[{pdus=[Ljava.lang.Object;@4027da00}] } from org.anddev.android.smstretcher requires android.permission.RECEIVE_SMS


Arrow what means we forgot to update the permissions:
instead of:
XML:
   <uses-permission id="android.permission.RECEIVE_SMS" />

use:
XML:
   <uses-permission android:name="android.permission.RECEIVE_SMS" />


Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
robisen
Junior Developer


Joined: 21 Feb 2008
Posts: 12

PostPosted: Thu Feb 21, 2008 10:59 pm    Post subject: Can you show how you would pass a notification to top bar Reply with quote

Can you show how you would then send a notification, instead of a toast, to the status bar?

Thanks
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1887
Location: Germany

PostPosted: Tue Feb 26, 2008 8:00 pm    Post subject: Reply with quote

Hello robisen,

did the Tutorial some days ago after you posted Arrow http://www.anddev.org/viewtopic.php?t=1019
Forgot to post her Wink

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
robisen
Junior Developer


Joined: 21 Feb 2008
Posts: 12

PostPosted: Tue Feb 26, 2008 8:24 pm    Post subject: reply Reply with quote

Great but I had figured it out. One of my issues was trying to use a deprecated constructor. BTW do you find the drop down for the default SMS inbox view annoying? I sure do.
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1887
Location: Germany

PostPosted: Wed Feb 27, 2008 10:07 am    Post subject: Reply with quote

Hello robisen,

its also for all the notifications and missed calls, etc...

The good thing is that it is accessible from everywhere. You can pull it down above any other Activity.

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
inter
Junior Developer


Joined: 21 Feb 2008
Posts: 22

PostPosted: Wed Mar 05, 2008 10:46 am    Post subject: Reply with quote

Hi ,plusminus

How to send a SMS message to Android on localhost ? To test program above ?

Thank you
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1887
Location: Germany

PostPosted: Wed Mar 05, 2008 11:37 am    Post subject: Reply with quote

Hello inter,

use the search function.
It returns results like: [TinyTut] - Simulating incoming Phone Calls / SMS in ECLIPSE

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
inter
Junior Developer


Joined: 21 Feb 2008
Posts: 22

PostPosted: Sat Mar 08, 2008 4:57 pm    Post subject: Reply with quote

Hello ,plusminus .Thank you for reply


I want to build an chat application on Android .Do you know where I can view tutorial about it

Thanks
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1887
Location: Germany

PostPosted: Sat Mar 08, 2008 5:44 pm    Post subject: Reply with quote

I haven't done a chat-app. Smile

If you experience problems during your development process, let us know.

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abhilash
Developer


Joined: 22 Feb 2008
Posts: 26
Location: HYDERABAD

PostPosted: Wed Mar 12, 2008 6:33 am    Post subject: can i get code for sending a sms Reply with quote

hi
can any one post a code for sending sms
Back to top
View user's profile Send private message Send e-mail
dkkundudolan
Junior Developer


Joined: 03 Mar 2008
Posts: 12

PostPosted: Wed Mar 19, 2008 2:38 pm    Post subject: SMSReceiver prob? Reply with quote

Hi,
I had tried SMSReceiver. but its not working. its shoing message that java.lang.classNoFoundException.
hw 2 do this.?
please reply me fast.

Thanks,
Dolan.
i had gone through the following:

package com.smsreceiver.android;
import android.content.Context;
import android.content.Intent;
import android.content.IntentReceiver;
import android.os.Bundle;
import android.provider.Telephony;
import android.telephony.gsm.SmsMessage;
import android.util.Log;
import android.widget.Toast;

public class SMSReceiver extends IntentReceiver {

private static final String LOG_TAG = "SMSReceiver";

private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";

public void onReceiveIntent(Context context, Intent intent) {
if (intent.getAction().equals(ACTION)) {

StringBuilder sb = new StringBuilder();


Bundle bundle = intent.getExtras();
if (bundle != null) {

SmsMessage[] messages =
Telephony.Sms.Intents.getMessagesFromIntent(intent);


for (SmsMessage currentMessage : messages){
sb.append("Received compressed SMS\nFrom: ");

sb.append(currentMessage.getDisplayOriginatingAddress());
sb.append("\n----Message----\n");

sb.append(currentMessage.getDisplayMessageBody());
}
}

Log.i(LOG_TAG, "[SMSApp] onReceiveIntent: " + sb);


Toast.makeText(context, sb.toString(), Toast.LENGTH_LONG).show();


this.abortBroadcast();


Intent i = new Intent(context, SMSActivity.class);
i.setLaunchFlags(Intent.NEW_TASK_LAUNCH);
context.startActivity(i);
}
}
}

plusminus wrote:
Hello mjpan,

did you try the Category-Thing Question

There is no official Bug-Tracking-System yet, but on my Bugs posting them to the GoogleGroups and hoping a moderator would see them was fine ^^.

Regards,
plusminus
Back to top
View user's profile Send private message
Ghalya
Freshman


Joined: 09 Feb 2008
Posts: 9
Location: Dubai, UAE

PostPosted: Wed Mar 19, 2008 6:53 pm    Post subject: Re: Recognize/React on incoming SMS Reply with quote

thx Wink
Back to top
View user's profile Send private message
ryank
Developer


Joined: 28 Jan 2008
Posts: 41

PostPosted: Fri Apr 04, 2008 12:50 am    Post subject: Reply with quote

Great tutorials +/-!

I have read a number of posts on here regarding sending/recieving SMS messages. I am wanting to send xml from my app on one phone (emulator) to my app on another phone. Is the best way to do this using SMS?

If so, it sounds like I might want to use eclipse to simulate the send? Is that correct? If so, how can I verify the communication works as expected? Please let me know if I am misunderstanding.

Also, in order for my app to recieve the intent, does the user need to have my app running? Or do I need to implement as a service or something?

Thanks!
ryank
Back to top
View user's profile Send private message
AMGG
Once Poster


Joined: 15 Jan 2008
Posts: 1
Location: Madrid

PostPosted: Mon Apr 07, 2008 8:08 pm    Post subject: Reply with quote

Hi!

First of all (this is my first post since I registered in the page) congratulations plusminus for this great web, and many thanks for share your knowledge.

I'm trying the "Post reply" tutorial, but when I send a sms from the console (sms send <tlf number> <text>) nothing happens in the emulator.

Should I make some kinda registration of the app in the emulator? or launch the emulator with a special params?

My code is just a merge between your PostReply and FriendFinder tutorials. I mean, when I receive a msg I want to launch the FriendFinder app. But nothing happens.

Here is my manifest:

XML:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="es.home.learn.friendFinder">

   
    <uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
    <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
 
    <uses-permission android:name="android.permission.ACCESS_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_GPS"></uses-permission>
   
    <application android:icon="@drawable/icon">
        <activity android:name=".FriendFinder" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".FriendFinderMap" android:label="@string/map_title">
          <intent-filter>
               <action android:name="android.intent.action.VIEW" />
               <category android:name="android.intent.category.DEFAULT"/>
          </intent-filter>
        </activity>
         <receiver android:name=".SmsReceiver">
          <intent-filter>
               <action android:name="android.provider.Telephony.SMS_RECEIVED"/>                
          </intent-filter>
          </receiver>
                   
    </application>
</manifest>


Thanks!
Back to top
View user's profile Send private message
bjreddi
Junior Developer


Joined: 03 Apr 2008
Posts: 17

PostPosted: Fri Apr 25, 2008 11:56 am    Post subject: Re: Recognize/React on incoming SMS: HELP Reply with quote

Plusminus,

Thank you very much in tutoring us with very good applications.

I have tried the example that u have posted. "Rect on incoming SMS"

I have two Java classes SMSActivity.java, SMSReceiver.Java. I just copied and ur code and ran the application.

I got this note when i ran the application:

"Helloworld, SMSActivity"

I didnt get any SMS received notification.

I did the way u mentioned in the tutorial.

I have no errors at all. But how to get the Notification. Please help me.

Regards,
Jyothi
Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Novice Tutorials All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.