한국어

Coding

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

    
페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app



https://stackoverflow.com/questions/8847876/android-sms-intent-filter



I tried this code in my android application for the SMS message but it is not working , the application does not appear in the messaging list. Should I add something to make it work?

             <action android:name="android.intent.action.SENDTO" />
               <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="sms" />
            <data android:scheme="smsto" />
                <data android:mimeType="text/plain" />

          </intent-filter>



I am providing you a detailed desc to do that in different case(with contacts, text shares etc).

Manifest Entry for you Message Activity

<!-- Defines also the app name in the Android menu -->
    <activity
    android:name="it.rainbowbreeze.smsforfree.ui.ActSendSms"
    android:label="@string/common_appName"
    >
    <!-- Sends sms for someone  -->
    <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <action android:name="android.intent.action.SENDTO" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="sms" />
    <data android:scheme="smsto" />
    </intent-filter>

    <!-- Sends text to someone .This will enable any Text Share functionality-->
    <intent-filter>
    <action android:name="android.intent.action.SEND" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="text/plain" />
    </intent-filter>
    </activity>

Now we have made a processIntentData method as shown below to be applied in Message Activity:

private void processIntentData(Intent intent)
{
    if (null == intent) return;

    if (Intent.ACTION_SENDTO.equals(intent.getAction())) {
        //in the data i'll find the number of the destination
        String destionationNumber = intent.getDataString();
        destionationNumber = URLDecoder.decode(destionationNumber);
        //clear the string
        destionationNumber = destionationNumber.replace("-", "")
            .replace("smsto:", "")
            .replace("sms:", "");
        //and set fields
        mTxtDestination.setText(destionationNumber);

    } else if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(intent.getType())) {
        //in the data i'll find the content of the message
        String message = intent.getStringExtra(Intent.EXTRA_TEXT);
        //clear the string
        mTxtBody.setText(message);
    }
}

Use as shown in Message Activity:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ...

    mTxtDestination = (EditText) findViewById(R.id.actsendsms_txtDestination);
    mTxtBody = (EditText) findViewById(R.id.actsendsms_txtMessage);

    ...

    //executed when the application first runs
    if (null == savedInstanceState) {
        processIntentData(getIntent());
    }
}

The attached snap for results: enter image description here

Try this code to send SMS, In your activity manifiest file grand android.permission.SEND_SMS permission.

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"
   >
<TextView 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/hello"
   />
<TextView 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="Enter Phone Number:"
   />
<EditText 
   android:id="@+id/smsnumber"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:inputType="phone"
   />
<TextView 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="Enter Phone SMS Text:"
   />
<EditText 
   android:id="@+id/smstext"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   />
<Button 
   android:id="@+id/sendsms"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text=" Send SMS "
   />
<Button 
   android:id="@+id/sendsms_intent"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text=" Send SMS using Intent.ACTION_SENDTO "
   />
</LinearLayout>

Now the Activity class is,AndroidSMS.java

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class AndroidSMS extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);

       final EditText edittextSmsNumber = (EditText)findViewById(R.id.smsnumber);
       final EditText edittextSmsText = (EditText)findViewById(R.id.smstext);
       Button buttonSendSms = (Button)findViewById(R.id.sendsms);
       Button buttonSendSms_intent = (Button)findViewById(R.id.sendsms_intent);

       buttonSendSms.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub
    SmsManager smsManager = SmsManager.getDefault();
    String smsNumber = edittextSmsNumber.getText().toString();
    String smsText = edittextSmsText.getText().toString();
    smsManager.sendTextMessage(smsNumber, null, smsText, null, null);
   }});

       buttonSendSms_intent.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub

    String smsNumber = edittextSmsNumber.getText().toString();
    String smsText = edittextSmsText.getText().toString();

    Uri uri = Uri.parse("smsto:" + smsNumber);
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    intent.putExtra("sms_body", smsText);  
    startActivity(intent);
   }});
   }
}
번호
제목
글쓴이
96 안드로이드 6.0 permission 가장잘된 예제
admin
10388   2019-12-12
 
95 How to fish notification enable
admin
10392   2019-10-13
 
94 FCM 푸시 메세지 전송
admin
10610   2019-09-27
 
93 안드로이드 웹뷰 webview 설명좀 잘해놓은곳 androidx 사용
admin
10665   2019-12-24
 
92 안드로이드 비동기 통신 결과값을 Textview set text 값 설정 기록 표시셋 이해 하기 쉽게
admin
10709   2019-12-17
 
91 안드로이드 원그래프 걱은선그래프 만들기 그리기
admin
10733   2019-12-24
 
90 [Android] activity 인텐트(Intent) 화면 간 이동과 데이터 전달 잘된설명
admin
11090   2019-12-24
 
89 Google wants developers to add dark themes to save battery life
admin
11316   2019-03-28
 
88 add set and cancel of the notification on those listeners
admin
11396   2018-12-14
 
87 안드로이드 디버깅 Logcat을 이용해서 로그 남기기
admin
11459   2019-09-18
 
86 Android Service and Jobscheduler sourcecode
admin
11481   2018-12-22
 
85 안드로이드 스튜디오 에서 팩키지명 변경하기 동영상 으로 보기
admin
11670   2018-10-01
 
84 런타임 안드로이드 권한 SDK 23 이상 권한 부여하기 코드
admin
11729   2018-12-06
 
83 android.os.Build.VERSION_CODES.O 오레오 알림 작성 소스코드
admin
11776   2018-12-14
 
82 안드로이드 개발시에 팩키지명 변경하기
admin
11800   2018-09-21
 
81 일반 Activity와 AppCompatActivity의 차이 ?
admin
11898   2018-12-06
 
Android sms intent filter SMS 보내기
admin
11951   2018-12-19
https://stackoverflow.com/questions/8847876/android-sms-intent-filter Android sms intent filterAsk Question up vote4down votefavorite4 I tried this code in my android application for the SMS message but it...  
79 Android OS 9 Pie 동작 변경사항 정리 개발자용
admin
11976   2019-05-25
 
78 FirebaseInstanceIdService is deprecated now FCM token
admin
12040   2019-05-29
 
77 goodbye to your implicit BroadcastReceivers
admin
12059   2018-05-01
 
76 Android 6.0 이상 접근권한 checkselfPermission source code
admin
12143   2018-09-06
 
75 안드로이드 버전 역사
admin
12149   2018-09-01
 
74 Questions & Answers Android 개발자
admin
12152   2018-04-26
 
73 안드로이드 스튜디오 PreferenceActivity로 설정창 쉽게 만들기
admin
12246   2020-01-17
 
72 Android Shape Drawable Examples
admin
12251   2018-12-05
 
71 android.telephony.TelephonyManager.getSubscriberId 베스트코드 code
admin
12280   2018-12-31
 
70 android.os.Build.VERSION_CODES.O 오레오 알림 작성
admin
12316   2018-12-14
 
69 JobScheduler - Android Studio Tutorial
admin
12337   2018-12-22
 
68 SDK Platform Release Notes
admin
12360   2018-05-13
 
67 android apk 패키징 v1, v2
admin
12487   2018-12-05
 
66 jobscheduler 간략하게 설명
admin
12530   2018-12-22
 
65 안드로이드 밧데리 전원 수명 오래쓰기 보안 최적화 끄기 끄는 방업 소개
admin
12553   2018-01-02
 
64 Notification에 관한 설명 자세한설명
admin
12569   2019-03-01
 
63 gcm 코딩 사례
admin
12598   2018-01-09
 
62 P is for Policy: Upcoming changes to Google Play
admin
12614   2018-05-13
 
61 안드로이드 android MediaPlayer how to work
admin
12622   2018-01-16
 
60 안드로이드 전화 수신 발신 이력조회 CALLLOG
admin
12634   2018-09-10
 
59 Uri to default sound notification?
admin
12637   2018-02-03
 
58 안드로이드 알람
admin
12693   2018-02-23
 
57 Improving app security and performance on Google Play for years to come
admin
12724   2018-05-13
 
56 How do I keep Wifi from disconnecting when phone is asleep?
admin
12729   2018-01-02
 
55 안드로이드 마쉬멜로우 버전 이상에서 권한처리하기.
admin
12773   2018-09-06
 
54 How to initialize default preferences for Settings in Android 초기값 설정
admin
12818   2018-04-25
 
53 android 9 startForeground requires android.permission.FOREGROUND_SERVICE
admin
12823   2019-05-25
 
52 안드로이드 버젼 별 특징 새로운 기능
admin
12839   2018-01-02
 
51 Gradle Wrapper를 통해 이용하기
admin
12854   2018-05-07
 
50 opensips Sipdroid Push notification how to
admin
12900   2017-12-27
 
49 Android Oreo의 알림 채널
admin
12914   2018-12-10
 
48 Android 9 Pie 새로운기능
admin
12928   2018-12-22
 
47 get path dir 함수 종합 정리
admin
12929   2018-05-25
 
46 Android 6.0(API 레벨 23)부터 사용자 런타임에 권한 요청
admin
12943   2018-12-05
 
45 WIFI_SLEEP_POLICY_NEVER how to set in API-17?
admin
12996   2018-01-02
 
44 사용자는 Settings > Battery > Battery Optimization에서 수동으로 허용 과 프로그램
admin
13001   2018-01-01
 
43 안드로이드 getDeviceId getImei MEID
admin
13030   2018-12-28
 
42 Android Contact APP with RecyclerView Part 1: Call Logs Example Android Studio
admin
13069   2018-11-18
 
41 Android-Oreo-Foreground-Service-Simple-Example 쉽고 정확한설명
admin
13190   2018-12-22
 
40 how do you import sound files like mp3 or waw files into android studio?
admin
13200   2018-01-02
 
39 안드로이드 : 컨텐트 제공자 (Content Provider) 연락처 데이터 ContentResolver 객체
admin
13218   2018-11-21
 
38 sdk-tools list
admin
13256   2018-05-13
 
37 firebase로 손쉽게 android 앱에 로그인 추가하기
admin
13341   2018-12-05
 
36 Firebase용 Cloud 함수
admin
13343   2018-04-26
 
35 안드로이드 사용자 주소록리스트 가져오기
admin
13490   2018-06-16
 
34 System Permission MODIFY_PHONE_STATE root device
admin
13496   2018-12-08
 
33 FCM PHP Curld
admin
13579   2018-01-01
 
32 FCM 원하는 액티비티 이름을 알림을 요청 전송하여 액티비티 열리게
admin
13611   2019-06-24
 
31 Migrate a GCM Client App for Android to Firebase Cloud Messaging
admin
13617   2017-12-04
 
30 unpublish an app in Google Play Developer Console 플레이스토어 앱 게시 삭제
admin
13649   2018-05-21
 
29 Doze 및 앱 대기 모드 최적화 GCM으로 Android M Doze 모드를 풀기
admin
13680   2018-01-09
 
28 [안드로이드 개발자 개발 ] 기본 스레드의 생명주기 관리 자세히 알아보기
admin
13757   2018-01-16
 
27 Android Drawable Resources Tutorial
admin
13757   2018-12-05
 
26 how to set CheckBoxPreference default value 체크박스 디폴트값 설정
admin
13807   2018-05-16
 
25 Firebase FCM 강제로 onTokenRefresh () 호출 [android] 서버로 json put token 전송
admin
13859   2018-04-26
 
24 Remote Notifications with Firebase Cloud Messaging
admin
13933   2018-01-02
 
23 안드로이드 마시맬로 6.0 이상의 런타임 권한
admin
14152   2018-12-05
 
22 Android 7.0 동작 변경 사항 밧데리 메모리 잠자기 모드
admin
14205   2018-01-02
 
21 안드로이드 개발자 개발 프로그램 7.0 누가 백그라운드 최적화
admin
14207   2018-01-16
 
20 동작 변경사항: API 레벨 28+를 대상으로 하는 앱 Android Pie
admin
14607   2018-12-22
 
19 Notification 을 사용 알림 지워지지 않고 여러개 표시 되게 하는 방법
admin
14712   2018-05-11
 
18 안드로이드 OREO 백그라운드 서비스 제한 대책
admin
14746   2018-12-22
 
17 Play Store to require new and updated apps to target recent API levels and distribute native apps with 64-bit support
admin
14785   2018-05-13
 
16 FCM 과 GCM 차이
admin
14914   2018-01-01
 
15 In favour of overriding onNewToken FirebaseMessagingService
admin
14958   2018-12-22
 
14 @Deprecated @Override 라는 어노테이션 사용 설명
admin
15136   2018-06-16
 
13 SMS 또는 통화 기록 사용 위험도 가 높거나 민감한 권한을 사용하는 것을 제한
admin
15175   2018-11-18
 
12 Doze 및 앱 대기 모드 최적화
admin
15182   2018-01-01
 
11 Service와 BroadcastReceiver로 스크린 화면 감지하기
admin
15394   2018-01-07
 
10 알림 애플리케이션의 정상 UI 외부에서 사용자에게 표시
admin
15469   2018-01-05
 
9 새로운 안드로이드 백그라운드 작업 처리법 : WorkManager
admin
16178   2018-11-25
 
8 Oreo 버전 이후 Foreground Service 사용 방법
admin
16494   2018-12-22
 
7 설정값 유지하기 ( SharedPreferences ) 쉽고 잘된설명
admin
17043   2018-03-22
 
6 Firebase Console의 Notification google android 구글 안드로이드 푸시
admin
17108   2018-01-04
 
5 안드로이드 앱 배터리 최적화 무시방법
admin
17315   2018-01-02
 
4 Runtime Permissions in Android Marshmallow 6.0 and above
admin
18463   2018-12-05
 
3 8.0 부터는 Notification Channel을 만들어 주기 하지 않으면 알림이 오지 않는다
admin
18819   2018-05-11
 
2 안드로이드 백 뒤로가기 버튼 back button of action bar in Android
admin
20966   2018-12-24
 
1 [Android] 배터리 최적화 대응하기: 도즈(Doze)와 어플 대기모드(App Standby)
admin
25176   2018-01-02