Monday, July 18, 2016

fatal error: 'openssl/ssl.h' file not found on Mac

Correcting the problem - 

First make sure Command Line tools are already installed. 

xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates


using Brew to update openssl - 
sudo brew update
sudo brew install openssl
sudo brew link --force openssl

Sunday, July 17, 2016

Adding curl library in C project in Xcode

Steps:
1. Click over the project name in Xcode.
2. Go to "Build Phases" and expand "Link Binary with Libraries".
3. Click "+" sign and "Add Other". 
4. Click "Shift" + "Command" + "G". This will launch a folder select dialogue.
5. Go to "/usr/lib" and then select "libcurl.dylib".

Friday, May 13, 2016

Setting System properties using ADB and accessing in #android code

ADB command to set system properties-

adb shell setprop test.android.Sysprop Sandeep 




Android code:

 try {

            Class clazz = Class.forName("android.os.SystemProperties");

            //Parameters Types
            @SuppressWarnings("rawtypes")
            Class[] paramTypes = new Class[1];
            paramTypes[0] = String.class;
            Method get = clazz.getMethod("get", paramTypes);

            //Parameters
            Object[] params = new Object[1];
            params[0] = "test.android.Sysprop";
            String ret = (String) get.invoke(clazz, params);
            Log.i(TAG,"ret:"+ret);
        }catch(Exception e){
            Log.e(TAG,e.getMessage(),e);
        }