Sunday, July 26, 2015

python: can't open file '\bin\cfx': [Errno 2] Mozilla extension development

Today, I downloaded Mozilla SDK on my 64-bit Windows 7 PC and ran cfx init command to start. Then it threw this error

python: can't open file '\bin\cfx'

 When i opened cfx.bat file in the SDK\bin folder, it was looking for an environment variable called %VIRTUAL_EVN%

When I looked at my PC's environment variable list, I could not find it there. So I created it and pointed it to the SDK folder. (Not the bin folder) then error disappeared.


Monday, July 20, 2015

How to recognize that CyanogenMod in Android


static public boolean checkCyanogenMod() {
final Properties properties = System.getProperties();
String version = properties.getProperty("os.version");
final PackageManager pm = getAppContext().getPackageManager();

if (version.contains("cyanogenmod") || version.contains("-CM-")
|| pm.hasSystemFeature("com.cyanogenmod.account")
|| pm.hasSystemFeature("com.cyanogenmod.updater")) {
return true;
}

return false;
}