Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Class File Editor - Source not found - Change Attached Source - Eclipse

The source attachment does not contain the source for the file TextWatcher.class.
You can change the source attachment by clicking Change Attached Source below:

You have to add JDK src.zip path to dialog as on image below.
[caption id="attachment_1091" align="alignleft" width="282" caption="class file editor source not found Eclipse warning"]android/class-file-editor-source-not-found-282x300.png[/caption]

Or go to Project > Properties > Java Build Path > Libraries
Expand JRE System Library. Expand rt.jar.
Select Source attachment and double click or Edit.
Type path the source code file (External File…) and press OK.

[caption id="attachment_1094" align="alignleft" width="300" caption="Java project build path"]android/java-build-path-300x175.png[/caption]

Or type path in Java JRE definition

[caption id="attachment_1105" align="alignleft" width="300" caption="Java JRE deifiniton path in Eclipse"]android/java-jre-definition-eclipse-300x216.png[/caption]

How open String.class or others keywords definition with Eclipse.

Now if mouse move about keywords String or F3 on keywords and press button in yellow field will opened String.class


396LW NO topic_id


Další témata ....(Topics)


How evaluate any expression in Eclipse debugger editor Android example | how-evaluate-any-expression-in-eclipse-debugger-editor-android-example

Tutorial by pictures how evaluate a variable in Eclipse debugger window.

1.) Open Debug perspective in Eclipse and to start debugging a Activity.

2.) Open Display window from menu Window->Show view->Display


3.) Set breakpoint where you need to evaluate a variable.


4.) Debug the Activity to breakpoint.


5.) Into the Display window type code for evaluate your variable and execute code.


6.) Check if change of value a variable



How get package resource apk path on device Android example | how-get-package-resource-path-android-example

On Android device is path to *.apk like this example:

How get package *.apk path on device dynamically Android example

    public void onCreate(Bundle savedInstanceState) {
        String sPackagePath = getPackageResourcePath();

Get Context Java Android example | get-context-java-android-example

getContext() getApplicationContext() method Java Android example source

Context myContext_1 = ThisClassName.this; // to open a Dialog
Context myContext_2 = getContext();
Context myContext_3 = this.getContext();
Context myContext_4 = this;
Context myContext_5 = this.getApplicationContext ();

OnClickListener getImageBtnOnClick = new OnClickListener() {
public void onClick(View view) {
Context context = view.getContext();

// Toast
Toast.makeText(getApplicationContext(), "Context == getApplicationContext "
, Toast.LENGTH_SHORT).show();

// store Context in public class
public class MyActivity extends Activity {
public static Context myCnt = null;
protected void onCreate(Bundle icicle) {
myCnt = this;
// or
// MyStorage.setContext(this);

// cntxFromStorage == this
Context cntxFromStorage = MyStorage.getContext();

public class MyStorage
private static Context cntStorageContext = null;

public static Context getContext() {
return cntStorageContext;

public static void setContext(Context context) {
MyStorage.cntStorageContext = context;


class DataBaseHelper extends SQLiteOpenHelper {
// get MyActivity context
Context cnt = MyStorage.getContext();



Android startup tutorial for developers video | android-startup-tutorial-for-developers-video

How install Android emulator on PC

Download links:
Java Development Kit JDK download
Eclipse download
Android SDK download