December 19, 2013

Could not install Gradle distribution

Error: 
Gradle 'AmastanehTestApp' project refresh failed:
Cause: error in opening zip file
Gradle settings

ExternalSystemException
Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.9-all.zip'.
java.util.zip.ZipException: error in opening zip file
error in opening zip file: Could not install Gradle distribution from 'http://services.gradle.org/distributions/gradle-1.9-all.zip'.
java.util.zip.ZipException: error in opening zip file
error in opening zip file

Gradle invocation completed successfully in 0 sec


Solution:
Download the http://services.gradle.org/distributions/gradle-x.y-all.zip' file from link in above message and put it in C:/Users/[current user]/.gradle

November 27, 2013

How to Enable Developer Options on Android

Problem:
- How to enable developer settings on Android 4.2
- How to Enable Developer Options on the KitKat
- How to Enable Developer Options on the Nexus
- ... Android's Developer Options ...

Solution:
- Go to Settings
- Go to About (or About Tablet or somethings like)
- Go to Build Number (usually in last item)
- Tap on this part more than 7 times
- Congratulation ... Back to settings and go to last item in list and enjoy of Developer Options 

October 30, 2013

How to Disable Screen Lock

Problem
- How to disable Pattern Screen Lock
- "Disabled by Administrator, encryption policy, or credential ...
- Can't disable screen lock
- Can't disable pattern screen lock

Case Study (Screen lock)
None (Grayed out) Disabled by administrator, encryption policy, or credential storage. 
Slide (Grayed out) Disabled by administrator, encryption policy, or credential storage.
Face Unlock (Grayed out) Disabled by administrator, encryption policy, or credential storage.
Pattern (Enabled)
PIN (Enabled)
Password (Enabled)

Solution
Go to SETTINGS > Security > Clear credentials (last item) and then go to Screen lock

October 20, 2013

Visual C++ DLL in C#

Questions:
- VC++ DLL in C#
- How to call C++ DLL in C#
- How to call a Visual C++ method in C# by DllImport
- DllImport in C# ... Visual C++ Dll
- How to use DllImport a C++ class

Error:
- Unable to find an entry point named ...

Solution:
Add these lines in VC Project
extern "C"
{
    __declspec(dllexport) int Sum(int a, int b) {return a + b;}
    __declspec(dllexport) int Mul(int a, int b) {return a * b;}
}

Add these lines in C-Sharp Project
public static class DllHelper
{
    [DllImport("XYZ.dll")]
    public static extern int Sum(int a, int b);
    [DllImport("XYZ.dll")]
    public static extern int Mul(int a, int b);
}