Monday, June 29, 2015

Working with #Genymotion - Some tips

Kill and Start Genymotion from terminal-
ps ax | grep "Player.app" | grep -v "grep" | xargs kill
VBoxManage list vms
/Applications/Genymotion.app/Contents/MacOS/player --vm-name






To access your localhost through Genymotion is using your mac IP address. To get your IP address type on Terminal -  ifconfig
then search for IPv4, copy the IP and paste it in your URL. 
For example 
inet 192.168.1.81

It should looks like the following:
String exampleURL = "http://192.168.1.81:8080/....";

Monday, June 22, 2015

Git command

 to delete all branched other than master:
git branch | grep -v master | xargs git branch -D

to reset master:
git reset --hard origin/master



Thursday, June 11, 2015

Working with Node.js server

server.js

var http = require('http');
http.createServer(function (req, res) {
var body="";
req.on('data', function (chunk) {
    body += chunk;
  });
  req.on('end', function () {
    console.log('POSTed: ' + body);
    res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('success');
  });

}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');


node server.js start the server

-------------
 Close the server

hello:tcps-service sandeepshabd$ ps aux | grep node

sandeepshabd    60569   0.0  0.0  2432772    672 s003  S+    1:16PM   0:00.00 grep node
sandeepshabd    60542   0.0  0.2  3067496  20056 s001  S+    1:11PM   0:00.18 node server.js


hello:tcps-service sandeepshabd$ kill -2 60542

Proguard change to remove only the log files from android app

proguard-rules.pro
-dontwarn **
-target 1.7
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose

-optimizations !code/simplification/arithmetic,!code/allocation/variable
-keep class **
-keepclassmembers class *{*;}
-keepattributes *

#This will not remove error log
-assumenosideeffects class android.util.Log {
   #public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
   #public static int e(...);
}




-----------------------------build.gradle ---------------------
buildTypes {

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

--------------------------------------