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 939349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:46:33+00:00 2026-05-15T21:46:33+00:00

I was testing android minSDKVersion property and find a strange behavior- I put minSDKVersion=3

  • 0

I was testing android minSDKVersion property and find a strange behavior-

I put minSDKVersion=3 (1.5) and targetSDKVersion=4 (1.6) in androidManifest.xml file.

For testing, I put following lines in onCreate method of launching activity –

 android.telephony.SmsManager sm = android.telephony.SmsManager.getDefault();
 ArrayList<String> stringArray = sm.divideMessage("this is message");
 Toast.makeText(this, stringArray.get(0), Toast.LENGTH_LONG).show(); 

android.telephony.SmsManager class is being introduced in android 1.6.

After adding these lines, on 1.6 emulator it was showing toast, but on 1.5 emulator it did not show toast and did not crashed either.

I was expecting that the application will crash on 1.5 emulator but this did not happen.
Can anyone explain this?

Thanks

  • 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-05-15T21:46:34+00:00Added an answer on May 15, 2026 at 9:46 pm

    Attempting to call methods of classes that aren’t available will result in an exception.

    It isn’t clear to me why you did not observe a crash. Perhaps you have other code that is saving you.

    Manifest:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.versions"
          android:versionCode="1"
          android:versionName="1.0">
        <application android:icon="@drawable/icon" android:label="@string/app_name">
            <activity android:name=".MinSdk"
                      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>
        <uses-sdk android:minSdkVersion="3" />
    
    </manifest> 
    

    Activity Code:

    package com.example.versions;
    
    import java.util.ArrayList;
    
    import android.app.Activity;
    import android.os.Bundle;
    import android.telephony.SmsManager;
    import android.widget.Toast;
    
    public class MinSdk extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            SmsManager sm = SmsManager.getDefault();
            ArrayList<String> stringArray = sm.divideMessage("this is message");
            Toast.makeText(this, stringArray.get(0), Toast.LENGTH_LONG).show(); 
        }
    }
    

    Dump of Logcat when run in Android 1.5 emulator:

    E/dalvikvm(  779): Could not find method android.telephony.SmsManager.getDefault, referenced from method com.example.versions.MinSdk.onCreate
    W/dalvikvm(  779): VFY: unable to resolve static method 3: Landroid/telephony/SmsManager;.getDefault ()Landroid/telephony/SmsManager;
    W/dalvikvm(  779): VFY:  rejecting opcode 0x71 at 0x0008
    W/dalvikvm(  779): VFY:  rejected Lcom/example/versions/MinSdk;.onCreate (Landroid/os/Bundle;)V
    W/dalvikvm(  779): Verifier rejected class Lcom/example/versions/MinSdk;
    W/dalvikvm(  779): Class init failed in newInstance call (Lcom/example/versions/MinSdk;)
    D/AndroidRuntime(  779): Shutting down VM
    W/dalvikvm(  779): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
    E/AndroidRuntime(  779): Uncaught handler: thread main exiting due to uncaught exception
    E/AndroidRuntime(  779): java.lang.VerifyError: com.example.versions.MinSdk
    E/AndroidRuntime(  779):    at java.lang.Class.newInstanceImpl(Native Method)
    E/AndroidRuntime(  779):    at java.lang.Class.newInstance(Class.java:1472)
    E/AndroidRuntime(  779):    at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
    E/AndroidRuntime(  779):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2186)
    E/AndroidRuntime(  779):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
    E/AndroidRuntime(  779):    at android.app.ActivityThread.access$1800(ActivityThread.java:112)
    E/AndroidRuntime(  779):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
    E/AndroidRuntime(  779):    at android.os.Handler.dispatchMessage(Handler.java:99)
    E/AndroidRuntime(  779):    at android.os.Looper.loop(Looper.java:123)
    E/AndroidRuntime(  779):    at android.app.ActivityThread.main(ActivityThread.java:3948)
    E/AndroidRuntime(  779):    at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime(  779):    at java.lang.reflect.Method.invoke(Method.java:521)
    E/AndroidRuntime(  779):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    E/AndroidRuntime(  779):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    E/AndroidRuntime(  779):    at dalvik.system.NativeStart.main(Native Method)
    D/dalvikvm(  541): GC freed 2 objects / 48 bytes in 194ms
    I/Process (  575): Sending signal. PID: 779 SIG: 3
    I/dalvikvm(  779): threadid=7: reacting to signal 3
    I/dalvikvm(  779): Wrote stack trace to '/data/anr/traces.txt'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to test an Android app following the instructions here: http://www.jetbrains.com/idea/webhelp/testing-android-applications.html and here
I currently use the Android Monkey tool for stress testing Android system/packages. I find
I've been following book about Android testing and implemented this sample: public class TemperatureConverterActivityTests
Hi i am testing android E-mail application . I have configured an Exchange account
Has anyone used Robotium or Calculon for testing Android apps? Are they useful? Any
When testing on real Android devices, I run my application from within Eclipse and
As Android developers, we know the important of testing on physical devices--and as many
Hi guys: I am testing the camera fps on android system. I've set up
I am testing this sample on version 13 of android (3.2) and I have
I update my eclipse and I am testing on a real android device. I

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.