Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7775375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:36:53+00:00 2026-06-01T17:36:53+00:00

Here is the .java file: package sms1.android.pkg; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import

  • 0

Here is the .java file:
package sms1.android.pkg;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;

public class Sms1Activity extends BroadcastReceiver {
private static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
public void onReceive(Context _context, Intent _intent) {
    if (_intent.getAction().equals(SMS_RECEIVED)) {
    Bundle bundle = _intent.getExtras();
    if (bundle != null) {
    Object[] pdus = (Object[]) bundle.get("pdus");
    SmsMessage[] messages = new SmsMessage[pdus.length];
    for (int i = 0; i < pdus.length; i++)
    messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
    for (SmsMessage message : messages) {
    String msg = message.getMessageBody();
    String to = message.getOriginatingAddress();

    try {
    // Construct data 
    String data = URLEncoder.encode("test", "UTF-8") + "=" + URLEncoder.encode(msg, "UTF-8");
    data = data +"&"+ URLEncoder.encode("mobile", "UTF-8") + "=" + URLEncoder.encode(to, "UTF-8");  
    // Send data
    URL url = new URL("http://www.medibeep.in/xyz.php");
    URLConnection conn = url.openConnection();
    HttpURLConnection httpConnection = (HttpURLConnection)conn;
    conn.setDoOutput(true);
    OutputStreamWriter wr = new      OutputStreamWriter(httpConnection.getOutputStream());
    wr.write(data);
    wr.flush();
    wr.close();
} catch (Exception e) {
}
   }
    }
    }
    }
    }

Here is the .manifest file:

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name="sms1.android.pkg.Sms1Activity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

There is no error yet the .apk file crashes. Can someone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:36:55+00:00Added an answer on June 1, 2026 at 5:36 pm

    Register android.provider.Telephony.SMS_RECEIVED receiver in AndroidManifest as

        <receiver android:name=".Sms1Activity"> 
            <intent-filter> 
                <action android:name=
                    "android.provider.Telephony.SMS_RECEIVED" /> 
            </intent-filter> 
        </receiver>
    
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my .java file: package com.shoppinglist; import java.util.ArrayList; import android.app.Dialog; import android.app.ListActivity; import
my code is Here java file package org.example.webviewdemo; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView;
Here's the class package db; import java.io.File; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import
Here's my code for DroidArmoryActivity package com.maxgenero.droidarmory; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import
I'm trying to compile ActionFactory.java file which imports one of my package, RegisterAction.java Here
Referring here A is a precompiled Java class (I also have the source file)
For example I have a file name call A.java. Here its structure: public class
I'm programming Java in Eclipse IDE. Here is code I want to read file:
To use a contrived example in Java, here's the code: enum Commands{ Save(S); File(F);
I just want to know where am i wrong here: import java.io.*; class Tokens{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.