Thursday, July 23, 2015

Swipe menu for RecyclerView

https://github.com/baoyongzhang/SwipeMenuListView


Derby db start under Ubuntu

Start JavaDB (Derby DB) under Ubuntu
  
add into file /usr/lib/jvm/java-8-oracle/jre/lib/security/java.policy following string

permission java.net.SocketPermission "localhost:1527", "listen";

To perform execute this:
alxr@alxr-dell:~$ sudo gedit /usr/lib/jvm/java-8-oracle/jre/lib/security/java.policy 

Pathes could vary
To make sure run sysinfo:
Start server from point where you have right to write.
For example you can create folder for database in home folder (for me it's /home/alxr):

Now you can run:

Leave this window alone. Server works, any further movements you should do in other  windows.



Thursday, July 16, 2015

Ormlite single quote issue solution

Correct way to implement com.j256.ormlite.stmt.Where<T, ID>:

you should use com.j256.ormlite.stmt.SelectArg object instead of using Object
SelectArg arg = new SelectArg();
titleArg.setValue(value);
Where<T, ID> where = where.eq(fieldName, arg);

Using this way you will avoid this issue http://stackoverflow.com/questions/26254896/android-ormlite-selectarg i.e. if  String value contains single quote.


Wednesday, June 17, 2015

org.apache.http.client.methods.HttpGet deprecated!


HttpGet , HttpPost (and so on) are deprecated now (since API 22).
What should I use instead?
Big daddy suggests to use HttpURLConnection but it doesn't support PATCH.
I feel little bit frustrated.

upd. colleague suggests OkHTTP

Tuesday, June 9, 2015

WiFi and Android device

Sometimes shit happens.
You use your own wifi on Android device. And one day it stops to work.
Bad news - wifi router could be hacked.
Good news - you can install special programm into your Android device to continue using wifi via your router.
Here is link to google play https://play.google.com/store/apps/details?id=com.dnset
Here is APK (sometimes you cannot use googleplay) download from my google drive