How to prevent screen capturing in Android

Prevent screen capturing is way for saving your content. Android SDK have special flag for it. https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE Just declare it in your Activity like this: @Override protected void onCreate(Bundle savedInstanceState) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ….. } And user will see next message when try make screenshot:

How to fix “undefined reference to ‘__atomic_exchange_4”

When I built native library for LatinIME I’ve got next error: undefined reference to ‘__atomic_exchange_4 Full stacktrace: /Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/include/memory:635: error: undefined reference to ‘__atomic_load_4’ /Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/cxa_handlers.cpp:112: error: undefined reference to ‘__atomic_exchange_4’ /Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/cxa_default_handlers.cpp:106: error: undefined reference to ‘__atomic_exchange_4’ /Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/cxa_default_handlers.cpp:117: error: undefined reference to ‘__atomic_exchange_4’ clang++: error: linker command failed with exit code 1 Read more…

Build native libs for LatinIME. Error: base class ‘class latinime::NgramListener’ should be explicitly initialized in the copy constructor [-Werror=extra]

I working on LatinIME Android Keyboard keyboard. I’ve got source from Google repo. Here is structure: java – contains java code native – jni code. When I try to build native I receive next error: ‘latinime::MultiBigramMap::BigramMap::BigramMap(const latinime::MultiBigramMap::BigramMap&)’: jni/src/suggest/core/dictionary/multi_bigram_map.h:56:9: error: base class ‘class latinime::NgramListener’ should be explicitly initialized in the copy Read more…

How to flash Nexus 5 Hammerhead

Hi Guys, Please do the next instructions with your own risk. Download stock Image from https://developers.google.com/android/nexus/images I’ve downloaded 6.0.1 (MOB31E) Inzip Image Unlock the device’s bootloader fastboot flashing unlock or, for older devices, run the next: fastboot oem unlock Execute the flash-all script from ZIP. Start the device in fastboot mode again. Lock Read more…

Android: PocketSphinx speech/voice recognition library in background.

As you know we have Google Voice for voice recognition. Here is simple way to implement offline speech recognition using PocketSphinx lib. I’ve created simple app which will run Service with speech recognition functionality. You can add one keyword here: recognizer.addKeyphraseSearch(KWS_SEARCH, KEYPHRASE); Sure PocketSphinx have multi-keyword functionality. File menuGrammar = Read more…

Image loading in Android.

There a lot libraries for loading images. Lets talk about couple of them. Picasso (http://square.github.io/picasso/) dependency dependencies { compile ‘com.squareup.picasso:picasso:2.5.1’ } This library easy to use. To load image from url to ImageView you need do just one line. Picasso.with(context).load(“http://i.imgur.com/DvpvklR.png”).into(imageView); Current library have a features which can be useful for your Read more…