Json parsers online
Really useful for debugging JSON data.
http://json.parser.online.fr/
https://jsonformatter.curiousconcept.com/
Generate Java Objects from JSON
http://www.jsonschema2pojo.org/
Very useful tool when you need to fetch data from REST API with Retrofit library.
Great example how it used with RxJava: https://youtu.be/JCLZ55M2gVo?t=35m53s
RxJava magic on Android
RxJava – a library for composing asynchronous and event-based programs by using observable sequences.
Barcode Detector – Simple example
1. Dependencies:
dependencies {
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
}
2. Initialization code:
private BarcodeDetector detector;
...
private void initAndCheckDetector() {
detector = new BarcodeDetector.Builder(getActivity().getApplicationContext())
.setBarcodeFormats(Barcode.DATA_MATRIX | Barcode.QR_CODE | Barcode.EAN_13)
.build();
if (!detector.isOperational()) {
Toast.makeText(getActivity().getApplicationContext(), "Could not set up the detector!", Toast.LENGTH_SHORT).show();
detector = null;
}
}
Recognize Barcode:
private void recognizeBarcode(Bitmap myBitmap ) {
if (detector!= null) {
Frame frame = new Frame.Builder().setBitmap(myBitmap).build();
SparseArray<Barcode> barcodes = detector.detect(frame);
Barcode code = barcodes.valueAt(0);
String result = code.rawValue;
}
}
LeakCanary – SuperSonic causes an activity leak
After watching “Speed app your app” I tried to use the LeakCanary lib and I was surprised:
SuperSonic that I was using in my current project, caused an activity leak.
Speed app your app
Real examples for performance issues, and how to identify them with the available tools.
http://blog.udinic.com/2015/09/15/speed-up-your-app
Software keyboard control
Add soft keyboard listener:
final View activityRootView = getWindow().getDecorView().findViewById(android.R.id.content);
activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
int heightDiff = activityRootView.getRootView().getHeight() - activityRootView.getHeight();
if (heightDiff > 100) { // 99% of the time the height diff will be due to a keyboard.
if (!isSoftKeyboardOpen) {
MyLogger.log(TAG, "Soft keyboard is visible");
isSoftKeyboardOpen = true;
}
isSoftKeyboardOpen = true;
} else if (isSoftKeyboardOpen) {
MyLogger.log(TAG, "Soft keyboard invisible");
isSoftKeyboardOpen = false;
removeFocusAndSaveToDB();
}
}
});
Opens soft keyboard when alert dialog shown:
alertDialog.getWindow()
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
Oracle certification, Java SE 7 Programmer I (1Z0-803)
Useful information about this exam:
- Oracle, Java tutorial for Programmer Level I Exam: http://docs.oracle.com/javase/tutorial/extra/certification/javase-7-programmer1.html
- Sample questions: http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=303&p_certName=SQ1Z0_803
- Questions with detailed explanations: http://enthuware.com/
- This book really helped me pass the exam: https://www.manning.com/books/oca-java-se-7-programmer-i-certification-guide
And this is how the Java SE 7 Programmer I certification looks like:

