If you updated your device from Android 5.1 to 6.0 without wiping all data you noticed that the quick setting and home button have stopped working. That because the OS thinks the setup wizard is running and it’s trying to prevent you from escaping it. If you check logcat you’ll see a
Not starting activity because user setup is in progress message when you press the home button.
To get rid of the issue, you have to manually start the setup wizard so it sets the “initial setup succeeded” flag. On Android 6.0 the activity is called
SetupWizardTestActivity and can be invoked via adb with:
adb shell am start -n com.google.android.setupwizard/.SetupWizardTestActivity
Click through the wizard and the issue will disappear.Continue reading
C and C++ compilers aren’t the fastest pieces of software out there and there’s no lack of programmer jokes based on tedium of waiting for their work to complete.
There are ways to fix the pain though - one of them is ccache. CCache improves compilation times by caching previously built object files in private cache and reusing them when you’re recompiling same objects with same parameters. Obviously it will not help if you’re compiling the code for the first time and it also won’t help if you often change compilation flags. Most C/C++ development however involves recompiling same object files with the same parameters and ccache helps alot.
For illustration, here’s the comparison of first and subsequent compilation times of a largish C++ project:
CCache is available in repositories on pretty much all distributions. On OS X use homebrew:
brew install ccache
and on Debian-based distros use apt:
apt-get install ccache
After ccache is installed, you need to tell CMake to use it as a wrapper for the compiler. Add these lines to your
# Configure CCache if available
cmake and next
make should use ccache for wrapper.
Usage with Android NDK
CCache can even be used on Android NDK - you just need to export
NDK_CCACHE environment variable with path to ccache binary.
ndk-build script will automatically use it. E.g.
(Note that on Debian/Ubuntu the path will probably be
CCache statisticsContinue reading
One of the most commonly asked questions on Freenode/#ffmpeg is how to use it to encode videos for YouTube in accordance to Googles Recommended upload encoding settings. Conforming to the guideline is rather simple, but not straightforward for the newcomer.
1. Get newish ffmpeg
Get decently new and updated ffmpeg - the current stable release is 2.7.
brew install ffmpeg
Get a 64-bit static build from Zeranoe’s site.
Get a 64-bit static build from Linux static build site.
2. The command line
ffmpeg -i <input file> -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart <output_name>.mp4
This should suffice for full conformity. Explanation of parameters used:Continue reading
Live video streaming is still a touchy subject and not well supported across browsers and mobile devices. Hence I did a short overview of how to start on this years WebCamp Ljubljana. The lecture has since been published as a video as well.
Relevant links from the slides:
Pre-built FFMpeg downloads - Official FFMpeg site with precompiled ffmpeg builds for major platforms
Nginx RTMP module - Video streaming server module for Nginx with RTMP, (Apple) HLS and DASH support
Video.js HTML5 video player - Free HTML5 video player that automatically detects browser capabilities and switches to Flash when necessary
Lecture videoContinue reading
Publishing Gradle AAR libraries is one of the bigger pain points with Android’s new build system - it’s not as integrated and direct as it is with the Maven build system. Pretty much anyone has his/he
Slovenian language has a terrible lack of widely available tools for text processing so about a year ago I had to build my own part-of-speech tagger based on widely available IJS JOS-1M corpus with he
Here I’m listing relevant links from the slide-deck which are good starting point for Solr deployment.
Apache Solr Reference Guide / Wiki - Use this for main reference, for some reson all Google links go to obsolete Solr Wiki.
Points of interest in the reference guide:
Language analysis - Guides for Solr configuration for different languages
Filter reference guide - List of all Lucene filters available in Solr with descriptions
Character filter reference guide - List of all Lucene filters working on character level (e.g. ščž -> scz collapse, punctuation removal, etc.)
Basic Solr Home - a minimal Solr home configuration with two cores configured for slovene and english language
NewsBuddy - an opensource full-text search site for news articles. It has a nice example of how to effectively configure Solr for Slovenian articles.
LemmaGen Slovenian lemmatizer - Solr plugin for slovenian lemmatization
Solr Client Libraries - List of Solr client libraries
PySolarized - My Solr/Python communication library with multilanguage support
Slide deckContinue reading
The trick to playing video with effects on Android is to use OpenGL for actual frame display and then use (API 11+) SurfaceTexture class to render video as a texture on screen. See GitHub for full app demo.
The process has two steps:
1. Initialize OpenGL Context to render on a SurfaceTexture
Since there is no
SurfaceTexture equivalent of
GLSurfaceView we have to initialize an OpenGL context manually. In bottom example we initialize OpenGL ES 2.0 context with disabled depth buffer prepared for 2D video rendering. We also define abstract
draw metod to be extended with our drawing logic.
- OLDER POSTS
- Page 1 of 4