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.