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

  • Home
  • SEARCH
  • 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 7773249
In Process

The Archive Base Latest Questions

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

The bytecode for system classes like android.os.Looper is simply a stub. For example, android.os.Looper.loop()

  • 0

The bytecode for system classes like android.os.Looper is simply a stub. For example, android.os.Looper.loop() from android.jar contains the following bytecode:

public static final void loop();
  Code:
   0:   new     #2; //class java/lang/RuntimeException
   3:   dup
   4:   ldc     #3; //String Stub!
   6:   invokespecial   #4; //Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
   9:   athrow

But in AOSP, I can see the real source code that performs message dispatch (see AOSP_ROOT/frameworks/base/core/java/android/os/Looper.java). So how is this class handled exactly by the android system? Is the real code patched in when compiling the system android.jar into dex file or does it happen at run-time within the Dalvik VM?

  • 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:05:31+00:00Added an answer on June 1, 2026 at 5:05 pm

    The android.jar which you compile your code against contains only public classes with public (constant) fields and public methods, but all of those methods contain no implementation. All methods with a return type other that void throw the “Stub!” RuntimeException.

    A runtime library with a real implementation is linked with your application only in a phone device or in an emulator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class in a common jar: public class Common { public
I am following Java Hibernate tutorial example from YouTube. Everything looks great until I
suppose that no bytecode is generated for a program, like in Ruby, Perl, or
I am dynamically generating new classes (using Javassist) and I would like to be
The following code gives an unreachable statement compiler error public static void main(String[] args)
I have the following code: public class Tests { public static void main(String[] args)
I have deployed WCF service on service on server and facing following exception. System.Security.SecurityException:
I've the following scenario: I've a byte[] that contains the .class data of a
Does anyone know why: public void foo() { System.out.println(Hello); return; System.out.println(World!); } Would be
A bytecode program is normally executed by parsing the instructions one at a time.

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.