Okhelp.cz

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.

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.
eclipse-debug-perspective


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

eclipse dislplay window

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

eclipse-toggle-breakpoint

4.) Debug the Activity to breakpoint.

eclipse-debugger-breakpoint


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

eclipse-type-evaluate-code-to-display-window


6.) Check if change of value a variable

eclipse-evaluate-a-variable


397LW NO topic_id



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


364

Android Studio gradle file comment same as java comment | android-studio-gradle-file-comment-same-as-java-comment



// single line
/*
multi line
*/
237

Programmatically determine if App is running on Android Emulator | programmatically-determine-if-app-is-running-on-android-emulator


You can get list by class Build
For example:

if(Build.MANUFACTURER.equals("unknown")) {
		// Emulator
	}


List of Build class getting from emulator:
"BOARD=unknown
BRAND=generic
CPU_ABI=armeabi
DEVICE=generic
DISPLAY=sdk-eng 2.1-update1 ECLAIR 35983 test-keys
FINGERPRINT=generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys
HOST=android-test-13.mtv.corp.google.com
ID=ECLAIR
MANUFACTURER=unknown
MODEL=sdk
PRODUCT=sdk
TAGS=test-keys
TIME=1273161972000
TYPE=eng
USER=android-build
"
191

Invalid proguard configuration file path Android Eclipse Error | invalid-proguard-configuration-file-path-android-eclipse-error


Invalid proguard configuration file path
C:\documents\my_android_projects\my_project\proguard.cfg does not exist or is not a regular file

Solution:
Check if exist file proguard.cfg in your project on the path C:\docum.........
If not exist, copy a file proguard.cfg from other project or create file proguard.cfg and insert
this source code to file and save this file.



-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}



From more details see:
//developer.android.com/guide/developing/tools/proguard.html
163

Set Tab Tabulator size in Eclipse Editor with image | set-tab-tabulator-size-in-eclipse-editor


Go to Eclipse menu:
Window -> Preferences -> Java -> Code Style -> Formatter
Press NEW profile or EDIT if have you some profile.
Setup your settings.
Save settings.

eclipse editor tab formating
75

The Labeled continue statement Java example | the-labeled-continue-statement-java-example


The Labeled continue statement as goto Java example.


public class MainClass {
	public static void main(String[] arg) {
		String[] arrayOfString = { "Hello", "people", "hello", "world!" };
		OuterLoop: for (int e = 0; e < 4; e++) {
			for (int i = 0; i < arrayOfString.length; i++) {
				if (arrayOfString[i].equals("hello"))
					continue OuterLoop;
				System.out.println(arrayOfString[i]);
			}
		}
	}
}
/*
Hello
people
Hello
people
Hello
people
Hello
people
*/


Editace Jana Žákovská : 2014-02-15 20:46:19
Počet článků v kategorii: 397
Url:how-evaluate-any-expression-in-eclipse-debugger-editor-android-example
Share
Share
Tweet