Android Create System Overlay Window like Facebook Chat Heads

For floating overlay window  in Android we need following permission on “AndroidManifest.xml”

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

How to open overlay window/ How get permission to draw overlay screen:

 public final static int Overlay_REQUEST_CODE = 251;
    public void checkDrawOverlayPermission() {
        if (Build.VERSION.SDK_INT >= 23) {
            if (!Settings.canDrawOverlays(mActivity)) {
                Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
                startActivityForResult(intent, Overlay_REQUEST_CODE);
            } else {
                openFloatingWindow();
            }
        } else {
            openFloatingWindow();
        }
    }

    private void openFloatingWindow() {
            Intent intent = new Intent(mActivity, FloatingWindow.class);
            mActivity.stopService(intent);
            mActivity.startService(intent);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        switch (requestCode) {
            case Overlay_REQUEST_CODE: {
                if (Build.VERSION.SDK_INT >= 23) {
                    if (Settings.canDrawOverlays(mActivity)) {
                        openFloatingWindow();
                    }
                } else {
                    openFloatingWindow();
                }
                break;
            }
        }
    }

We need to call checkDrawOverlayPermission() function to open overlay/floating window.

We need following functions to get focus on EditText of floating screen (Window on top of all applications)

   private void editTextReceiveFocus() {
        if (!wasInFocus) {
            mWindowsParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
            mWindowManager.updateViewLayout(mView, mWindowsParams);
            wasInFocus = true;
        }
    }

    private void editTextDontReceiveFocus() {
        if (wasInFocus) {
            mWindowsParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
            mWindowManager.updateViewLayout(mView, mWindowsParams);
            wasInFocus = false;
        }
    }

You can download complete source code with example form GitHub

Android System Overlay Window like Facebook Chat Heads

This overlay window is used in English Urdu Dictionary for Android smart phones.

Android floating window

Android Weight Limit Chart

In Android Weight Limit Chart we can show weight limit (Upper limit, lower limit and normal value) by different colors.

How to use it:

LimitLineChart mChart = (LimitLineChart) findViewById(R.id.chart1);
mChart.upperLimit = 70.5f; // Start of upper limit
mChart.lowerLimit = 50f; // End of lower limit
mChart.currentValue = 0f;
mChart.drawGraph();

Android weight limit chart, source code

Complete solution with example and source code is available on GitHub.com

Android Limit Chart

 

English Urdu Dictionary – Free

Dictionary English to Urdu

or Urdu to English Dictionary plays an important role in learning a language. The aim of this dictionary is to make English easy both for experts and beginners. English Urdu dictionary helps us to define words and find their easy meaning in English or in our Urdu language.

Pak English Urdu dictionary has the largest database of English Urdu words and we update this dictionary on daily basis even if you are not able to find any word typed in the search box, our database will save that word and it will be available in the next 24 hours with complete and comprehensive way. This Dictionary includes almost all the existing English vocabulary. You can also ask for the Urdu meaning of any difficult English word by contacting us via contact us page.

Are you studying English and you want to know the meaning in real Urdu font. Then this program is for you. This dictionary can be used in two modes, one is English to Urdu dictionary, and another is Urdu to English dictionary. A full and  complete offline English to Urdu Dictionary. You also can say its English to Urdu Dictionary. Urdu to English Dictionary, Pakistan Dictionary. The vocabulary of dictionary English to Urdu is constantly being updated. This is not only a Dictionary but also a learning tool. MCQ (Multiple Choice Question) option is available. There is auto suggestion so you need not type full words. This will be helpful to find out the meaning of any word.
Features : ( خصوصیات )

The leading and most trusted English to Urdu dictionary is now available for FREE!

Translate English to Urdu and Urdu to English. Set Urdu keyboard from mobile settings. More than 200000 English, Urdu words for offline translation. Big collection for offline dictionary. We try to store maximum meaning collection in offline.

WHAT MAKES PAK ENGLISH TO URDU DICTIONARY BETTER THAN OTHER DICTIONARIES?
. The most comprehensive coverage of English everywhere it’s spoken.
. The very latest vocabulary, with over 450,000 words, phrases and meanings.
The Pak English to Urdu Dictionary is a mobile dictionary  with advanced search and language tools that have become the staple of quality language apps from Mobile Systems. No internet connection is required to view the definitions or thesaurus. A Full and complete Urdu to English Dictionary.

> Easy to use, fast and works offline.
> Layout is very simple and is user friendly.
> App using Android system overlay window to find meaning anywhere in the app.
> Offline, work without Internet.
> Every word you ever viewed is stored in history.
> Urdu to English Dictionary & English to Urdu Dictionary.
> Fast Searching (کی تلاش ) for Urdu words and English words.
> Create Favorite words list.
> Text to speech dictionary English to Urdu.
> Word correction for mistype words.
A best Urdu to English Dictionary for travelers, business mans, players, students, teachers & learners
Download English Urdu Dictionary

WordPress – How to increase media library upload file size limit

This article is about

How to Set Maximum Upload File Size in wordpress:

We can increase upload file size limit in wordpress. Follow the steps to maximize the wordpress media libary upload file size limit. Open .htaccess file and add thse lines in .htaccess Continue reading “WordPress – How to increase media library upload file size limit”

Sending Email in Android without using the default / built-in app

It is very easy to programmatically send email without using default email application in android. We can send email by using gmail, hotmail, yahoo or your domain email like info@wisdomitsol.com Continue reading “Sending Email in Android without using the default / built-in app”

iPhone – Programmatically call navigation controller back button | root view

We can call navigation controller back button programmatically from any button click or any where in the screen. There is very simple code to go back in previous i-Phone screen. Continue reading “iPhone – Programmatically call navigation controller back button | root view”

Saving Activity state on Android when change orientation

In Android application when we change the orientation of device then our activity is recreated and some time we face the NullPointerException. To handle NullPointerException or other exceptions we can save current state and retrive the values or tell in AndroidManifest.xml that don’t destroy this activity.

Solution 1: Continue reading “Saving Activity state on Android when change orientation”