Pages

Monday, July 6, 2015

Android One Now Available In Pakistan



Google has finally launched the Android one phone in Pakistan.The new smartphone QMobile A1 is readily available for purchase at retail stores across the country. Q Mobile A1 is priced at 11,500 and is dual Sim.

Specifications:

1. Runs on Android 5.1 Lolipop

2. CPU 1.3 Ghz Quad Core

3. Camera: Rear 5MP , Front 2 Mp

4. Battery 1700 mAh

5. RAM 1 GB

6. Internal Memory 8 GB

7. Torch and FM radio



Download Driver Of Q Mobile A1 Here
Download PC Suite of Q MObile A1 here 

Android Studio Vs Eclipse

Android studio and Eclipse both are IDE to develop  Android applications. But Eclipse is old, Android Studio is new. Eclipse is obsolete without further support from Google so you will have problems downloading or working with updated API's or Libraries to support updated version of Android.

Studio uses gradle as build management system. With help of gradle you can automate build generation process simultaneously keeping different versions/variations of build. 

In the layout view you have the option to view both the actual layout and the xml at the same time, while in Eclipse you must choose between the two tabs. i.e Preview of resources (Drawables, styles, etc) along side code

Since Android Studio is quite new, you may not find answers online for the problems that you face. You will be getting more resources to learn for eclipse IDE than to android studio.

Android Studio can refactor your code in places where it’s just not possible using Eclipse and ADT. 

In Android Studio there is no need to manually add the .jar dependencies.

Friday, July 3, 2015

8 Computer Jokes That Will Make You Laugh.

1. How Programmers Review Code 






2. There is no cloud, its just someone else's computer 




3. 


Thursday, July 2, 2015

3 Must Have Websites For Android Developers

1. Material Design Colors: Download xml of material colors from here.



2. Icon Generator : Generate app icons, app bar icons, ,nine patch, notification icon from Android Asset Studio


3. App Icon Maker: Make glossy icons for your app here










Sunday, March 8, 2015

10 Must Have Apps For Your Android Smartphone

Here are 10 Android Apps that every Android owner should consider. These apps will make you more productive and smarter.
1. Pushbullet : Pushbullet, acts as a bridge between your mobile and desktop OSes. If you own an Android device, PushBullet is an easy way to push content to your Android device from desktop. With pushbullet you can send, files, note, links, reminders and addresses from your desktop to your phone/your friends phone (or vice versa) with just a click or two. Pushbullet automatically sends all your phone notifications over to your computer in the form of little windows. With Pushbullet, you can now copy something on one device and then paste it through another, instantly. This feature is called Universal Copy And Paste .
Download Pushbullet.

2. MXPlayer : Best media player for Android, capable of playing most types of video formats. Play your files with subtitles. It has other features like Pinch to zoom, zoom and pan  i.e Easily zoom in and out by pinching and swiping across the screen. Subtitles gesture i.e scroll forward/backward to move to next/previous text.
Download MXPlayer

Friday, February 13, 2015

How to use WhatsApp as Notepad.

1. Create a WhatsApp Group.
2. Add any friend.
3. Remove that friend.
Your notepad is ready :D

Saturday, September 28, 2013

Android Flashlight

You must add the permission  in AndroidManifest.xml:

1
2
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
Main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <Button 
        android:id="@+id/on_btn"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Turn Flash ON" />
</LinearLayout>

Thursday, June 20, 2013

Set textview and 2 buttons in a android layout

You use this relativeLayout, that the first Button (Your left button) has to be set after set the second button(Your right button). This only works, if the button, that should be right, still exists before setting the left button.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="10dip" >

    <RelativeLayout
        android:id="@+id/upperView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/darker_gray"
        android:orientation="vertical"
        android:padding="10dip" >

        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:text="Hello.."
            android:textColor="@android:color/white" />

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:text="Button 1" />

        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@+id/button1"
            android:text="Button 2" />
    </RelativeLayout>

    <ListView
        android:id="@+id/listView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/upperView" />

</RelativeLayout>

enter image description here

Wednesday, June 19, 2013

WebView Methods and properties Android


In on create
WebView wv = (WebView)findViewById(R.id.webView1);
wv.getSettings().setJavaScriptEnabled(true);


     
   if(isInternetAvailable()){
    wv.setWebViewClient(new myWebClient(){
       @Override
       public void onPageFinished(WebView view, String url)
       {
           /* Call whatever, It's finished loading. */
//                wv.setVisibility(View.VISIBLE);
//                iv.setVisibility(View.GONE);
               if (checkk==1)
               {
               
               }
               else{
                wv.setVisibility(View.VISIBLE);
               iv.setVisibility(View.GONE);
           
               }
             
               }
    });

    wv.loadUrl("http://www.google.com");
  }else {
 
  Toast.makeText(getApplicationContext(), "Use internet for better performance", Toast.LENGTH_LONG).show();
  }


public class myWebClient extends WebViewClient
{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
   // TODO Auto-generated method stub
   super.onPageStarted(view, url, favicon);
}

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
   // TODO Auto-generated method stub

   view.loadUrl(url);
   return true;


// or if you want to open default link in webiview and external in other browser
// if (Uri.parse(url).getHost().equals("http://www.google.com")) {
            // This is my web site, so do not override; let my WebView load the page
          //  return false;
        }
        // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
     //   Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
     //   startActivity(intent);
     //   return true;

}

public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {

// Toast.makeText(frontPagee.this, "Your Internet Connection May not be active Or " + description , Toast.LENGTH_LONG).show();
Toast.makeText(frontPagee.this, "Your Internet Connection May not be active ", Toast.LENGTH_LONG).show();
// checkk=1;

}
}

Tuesday, June 18, 2013

ListView -Top and bottom fixed

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
    >
        <TextView 
            android:textSize="12px" 
            android:text="something here" 
            android:layout_width="50px" 
            android:layout_height="wrap_content"
            /> 
        <TextView 
            android:textSize="12px" 
            android:text="something here" 
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
        />
    </LinearLayout>
    <RelativeLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
    >
        <LinearLayout
            android:id="@+id/footer"
            android:orientation="horizontal"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:layout_alignParentBottom="true"
        >

            <TextView 
                android:layout_height="wrap_content" 
                android:layout_width="0dip" 
                android:layout_weight="1" 
                android:textSize="12px" 
                android:text="50%" 
                /> 
            <TextView 
                android:layout_height="wrap_content" 
                android:layout_width="0dip" 
                android:layout_weight="1" 
                android:textSize="12px" 
                android:text="50%" 
            /> 

        </LinearLayout>
        <ListView
            android:id="@+id/tablebody"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_above="@id/footer"
        />
    </RelativeLayout>
</LinearLayout>

Monday, June 17, 2013

Android Vibrate on click

If you want to make the phone to vibrate when you click on a button from your application:
1. You have to declare in your AndroidManifest.xml the permission:
?
1
<uses-permission android:name="android.permission.VIBRATE"/> 

Tuesday, June 11, 2013

Android camera .set wallapaper

Android Camera App Tutorial

             In this tutorial how to take a photo using the Android Phone camera and set the photo as wallpaper.Here we are using a Image View and 2 buttons for two actions.Lets start learning.
STEP BY STEP

Facebook key-android hash key

To get android key hash code follow these steps (for facebook apps)
  1. Download the openssl for windows here
  2. now unzip to c drive
  3. open cmd prompt
  4. type cd C:\Program Files\Java\jdk1.6.0_26\bin
  5. then type only keytool -export -alias myAlias -keystore C:\Users\your user name\.android\myKeyStore | C:\openssl-0.9.8k_WIN32\bin\openssl sha1 -binary | C:\openssl-0.9.8k_WIN32\bin\openssl enc -a -e
i.e
keytool -exportcert -alias androiddebugkey -keystore C:\Users\YOURUSERNAME\.android\debug.keystore | C:\openssl-0.9.8k_WIN32\bin\openssl sha1 -binary | C:\openssl-0.9.8k_WIN32\bin\openssl enc -a -e

ENTER PASSWORD: android 
  1. Done


GOOGLE MAPS KEY

  1. open cmd prompt
  2. type cd C:\Program Files\Java\jdk1.7.0_10\bin
  3. then type  
keytool -v -list -alias androiddebugkey -keystore "C:\Users\YOUR USERNAME\.android\debug.keystore" 

password is android
4.copy md5 and sh1