Latest

Thursday, 3 May 2018

Android custom alert dialogue examples

Android custom alert dialogue examples

Custom alert dialog is small dialog which prompt to the user screen for the take a decision or show some information to the users.

Using custom alert dialog use when you ask a user to in yes or no that time you can use.

Example : Exit confiscation , Rename username , for review application.

Alert Dialogue methods and descriptions :


setIcon(Drawable icon) : This method set the icon of the alert dialog box.
setCancelable(boolean cancel able) :This method sets the property that the dialog can be cancelled or not
setMessage(CharSequence message) :This method sets the message to be displayed in the alert dialog
setMultiChoiceItems(CharSequence[] items, boolean[] checkedItems, DialogInterface.OnMultiChoiceClickListener listener) :This method sets list of items to be displayed in the dialog as the content. The selected option will be notified by the listener
setOnCancelListener(DialogInterface.OnCancelListener onCancelListener) : This method Sets the callback that will be called if the dialog is cancelled.
setTitle(CharSequence title) :This method set the title to be appear in the dialog
Implementation of Custom alert dialog in android

dialog_exit.xml


<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:orientation="vertical"    >
    <TextView        android:id="@+id/tv_title"        android:layout_width="300dp"        android:layout_height="50dp"        android:text="Exit Confirmation"        android:textSize="20dp"        android:gravity="center"        android:textColor="#ffffff"        android:background="@android:color/holo_red_dark"        />
    <TextView        android:layout_width="300dp"        android:layout_height="140dp"        android:text="Are you sure to Exit this application"        android:textSize="20dp"        android:gravity="center"        android:padding="5dp"        />
    <LinearLayout        android:layout_height="wrap_content"        android:layout_width="match_parent"        android:orientation="horizontal"        android:gravity="center"        >
        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            style="?attr/borderlessButtonStyle"            android:id="@+id/no"            android:text="No"            android:textSize="18dp"
            />
        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            style="?attr/borderlessButtonStyle"            android:id="@+id/yes"            android:text="YEs"            android:textSize="18dp"            />
    </LinearLayout>
</LinearLayout>




MainActivity.java
final Dialog dialog = new Dialog(MainActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.dialog_exit);
dialog.setTitle("Pick Background Image");

Button yes=(Button)dialog.findViewById(R.id.yes);
Button no=(Button)dialog.findViewById(R.id.no);

yes.setOnClickListener(new View.OnClickListener() {
    @Override    public void onClick(View v) {
        finish();
    }
});
no.setOnClickListener(new View.OnClickListener() {
    @Override    public void onClick(View v) {
        dialog.dismiss();
    }
});

dialog.show();
Output :
dialogue examples



Best antivirus for Android in 2018

Best antivirus for Android in 2018

Antivirus for androidWhy you need to antivirus for android

Today android is most used operating system in the world and that there many anti virus software and tools are making for secure your android phone.

Android operating system is open source so that any one can create application and theft your private data that harm yours privacy and reputation.

Android is less secure than IOS operating system.

How to secure your android phone

There are various  antivirus software or tools are available that secure your android phone,Some of them :

  1. AVG Anitivirus
  2. Avast Anitivirus 2018
  3. Kaspersky Mobile Antivirus
  4. Virus Cleaner
  5. Norton Security and Antivirus
  6. Security Master - Antivirus, VPN, AppLock, Booster
  7. 360 Security - Free Antivirus, Booster , Cleaner



1.AVG Antivirus 


Get AVG AntiVirus FREE 2018 for Android™ to help protect you from harmful viruses and malware. Keep your personal data safe with App Lock, Photo Vault, Wi-Fi Security Scan, and App Permissions advisor.

Download for Free Now!

Over 100,000,000 people already installed AVG’s antivirus mobile security apps. Join them now and:
✔ Scan apps, games, settings and files in real-time
✔ Boost speed by killing tasks that slow down your device
✔ Extend battery life with Power Save
✔ Clean unnecessary files to free up space
✔ Lock sensitive apps with a PIN, pattern, or fingerprint
✔ Enable locating your lost phone via Google Maps™
✔ Hide private photos in an encrypted Vault
✔ Scan Wi-Fi networks for threats
✔ Check Wi-Fi download and upload speed
✔ Get insight into the permission level of installed apps


2.Avast Antivirus 2018 

Protect against viruses & other types of malware with Avast Mobile Security, the world’s most trusted free antivirus app for Android.

Features :
✔ Antivirus Engine
✔ AppLock
✔ Call Blocker
✔ Anti-Theft
✔ Photo Vault
✔ Power Save
✔ Privacy Permissions
✔ Firewall (for rooted Android only)
✔ Charging Screen
✔ RAM Boost
✔ Junk Cleaner
✔ Web Shield
✔ WiFi Scanner
✔ WiFi Speed Test


3.Kaspersky Antivirus 

Kaspersky Internet Security for Android is a FREE-to-download antivirus solution to help keep phones and tablets – that can be even more vulnerable than your computer – as well as your private information secure from online dangers. Our new App Lock feature also protects personal data from prying eyes. 

Product features :



Background check - scans for viruses, spyware and Trojans 
Antivirus protection - acts as a virus cleaner & automatically blocks malware from phones & tablets
App Lock - lets you add a secret code to access your private messages, photos and more
Find my phone - tracks & finds your Android phone or tablet if it’s lost or stolen
Anti-Theft - protects vulnerable personal information from prying eyes
Anti-Phishing - keeps your financial information secure while shopping & banking online
Call blocker - blacklists unwanted phone calls and text/spam messages
Web filter - filters out dangerous links & sites while surfing the Web


4.Virus Cleaner ( Hi Security ) - Antivirus, Booster

Hi Security ( Virus Cleaner, Junk Clean, App Lock & Booster ) is one of the 🏆TOP rated (4.8★★★★★) free antivirus and security applications for Android phones, enjoyed by 69 millionusers worldwide. 


Hi Security - the best choice for a safer, faster and smoother phone experience.

Hi Security's Key Features 

Double Engine Antivirus - Super powerful virus detector and mobile threat remover
Super Cleaner - Remove all junk and cache files effectively 
Phone Booster - Significantly boost mobile to get it running faster and smoother 
CPU Cooler - Optimize CPU usage and stop overheating apps to cool down CPU temperature
File Scan - Scan both the internal and SD card 
App Lock - Protect sensitive apps with well-designed themes
Notification Cleaner - Manage and organize notifications
Call Blocking - Block unwanted calls or numbers 
WiFi Security - WiFi speed test and protect online safety
Privacy Cleaner - Clean up browsing and clipboard history
Safe Browsing - 24/7 online security protection 
Quick Charge Master - Charge battery quickly 


5.Norton Security and Antivirus

Norton Security & Antivirus is the all-in-one mobile security and virus protection app for your smartphone or tablet. 

FREE FEATURES 
Android Security
Android Protection
Privacy protection

★PREMIUM FEATURES (Free 30-Day Trial [1]) ★
• SafeWeb filtering - Prevent fraudulent websites from accessing your personal information
• App Advisor powered by Norton™ Mobile Insight, automatically checks apps for potential 
privacy risks, high battery and data usage or intrusive behavior before download
• Privacy Report Interactive Map shows where in the world apps send personal information and photos


6.Security Master - Antivirus, VPN, AppLock, Booster

The original CM Security upgraded to the new Security Master - Antivirus, VPN, AppLock, Booster (by CM, Cheetah Mobile) and redefined the scope of Phone Security: protects not only your phone but also your privacy. 
  • Security Master Key features: 
  • Intelligent Diagnosis - Antivirus, Junk Clean, and Phone Booster
  • Phone Boost, Battery Saver, and CPU Cooler – Remove background apps that take high memory usage, overheat and drain battery, optimize phone performance and speed up phone.
  • SafeConnect VPN
  • Message Security
  • AppLock

7.360 Security - Free Antivirus, Booster , Cleaner

Free Security Protection for Android Phone with Speed Booster, Junk Cleaner, Anti Spyware and Virus Remover

Highlights of 360 Security
Security & Antivirus
Junk File Cleaner
Speed Booster
Multi-function lock screen
CPU Cooler Master
Anti-theft
Privacy
Intruder Selfie
App Manager
Fingerprint Lock
Real time protection

Friday, 27 April 2018

How much youtube pay for 1000 views in india

How much youtube pay for 1000 views in india

Now YouTube is most popular earning platform, So everyone come on YouTube for earning.

There are lots of ways to earn money online like YouTube, blogging, affiliate marketing and much more. But in my experience YouTube is one of the best way to earn money online at home. 


The biggest advantage of YouTube is you do not need to buy a server for host your videos because of YouTube is completely free. You can simply create a channel and upload video. After that just enable the moentization option.


Download Ultimate Photo Blender Application

How much YouTube pay for 1000 views in india

In YouTube is pay approx $2-$6 for thousands view. Because when you watch YouTube video you observe it some time YouTube is not show ads in video.

YouTube is paid for click on ads in your video if ads watch time 5 to 30 seconds than YouTube pay otherwise not.

In India ads publishers are not paid so much money for displaying ads that's why Indian You Tubers revenue is less.

When you work on YouTube please know it not focus on earning please focus on content of your videos.


Download Awesome Photo Music Player Application

Android switch statement example

Android switch statement example

Android switch statement example

  • Definition : Based on the name switch provide many options you select one of them.
  • switch statement is same as if-else condition.
  • default : (optional) It is used for if all options are wrong than default statement is call.
  • break : Break switch statement (optional)

Example of Android switch statement :

int position=2;     
//you can used string,intent,object id based on your requirements 
//here select position 
switch (position)
{
    case 0:
        Toast.makeText(getApplicationContext(),"0",Toast.LENGTH_SHORT).show();
        break;
    case 1:
        Toast.makeText(getApplicationContext(),"1",Toast.LENGTH_SHORT).show();
        break;
    case 2:
        Toast.makeText(getApplicationContext(),"2",Toast.LENGTH_SHORT).show();
        break;
    default://
        Toast.makeText(getApplicationContext(),"default",Toast.LENGTH_SHORT).show();
        break;
}

Output : 

2

World News Hub provide 100+ different type of newspapers and different kind of news in various languages.
How to clear intent cache in android

How to clear intent cache in android

How to clear intent cache in android

Android intent is a object which is used for move from one activity to another activity.

generally every one start activity like this :

Intent i=new Intent(getApplicationContext(),MainActivity.class);
startActivity(i);


Why you need to clear intent cache in android

When you move from A activity to B activity after that you move B activity to C activity when move back from C activity B activity you reach the B activity after that you move back from B activity to A activity it move on C activity because of intent cache is not clear


Example :

Intent i=new Intent(getApplicationContext(),MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);

IF you want to finish current activity and move on next activity use this code : 

Intent i=new Intent(getApplicationContext(),MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
finish();


World News Hub provide 100+ different type of newspapers and different kind of news in various languages.Click her to download