Latest

    • Earn Money Online By Monetizing YouTube Videos

      You can earn money by enable monetization on your youtube videos. Its very simple and easy , so lets get started. Note : You must be from US region or from a region where youtube allow Video monetizaiton. In Asia , Youtube does not allow some countries to monetize their videos. Steps for Evaluation Step 1 : First of all you need to create a Google Account. So I assume that you already have a Google account. Step 2 : You need a video for monetization too. Note : The video you would have for monetization must not contain any violated contents or copyright claims. Otherwise , Youtube would reject your appeal for monetization. Plus you will not draw fake traffic to your monetized video as Youtube constantly crawl your videos. Step 3 : After creating your google account, open  www.youtube.com . Step 4 : Now click on "My Channel" option at the left side of the page. Step 5 : Now you will be confronted by this screen Step 6 : Now click on "Video Manager" option as highlighted in below image Step 7 : Now you will be confronted with below screen. Just click on the "Channel" option on the left side Step 8 : Now a list would open. Select "monetization" option from the list like below Step 9 : Now click on "Enable Monitization" button. In below screenshot , my channel's monitization is already enabled so you have to enable your own. When you click on "Enable Monitization" button , you will be directed to another screen asking for your google account or google adsense account. You must have either of the above accounts. And then give your login credentials and google will review your monitization process. After few days , google will send you message regarding approval or disapproval for your videos monitization. Note  : Remember , you must be from US region or from the region where Google allows monitization. Read Youtube terms and condition for Monitization from here  Youtube Monitization . Step 10 : After your monitization is approved and enabled. Upload the video to youtube and after that enable monitization on each single video you have uploaded. Go Back to "Video Manager" option located on the left side. Select your video and click on "Edit" button like below Step 11 :  Click on the "monitization" button like below Step 12 : Now check "Display ads" option and monitization will be enabled on your video. Now you are able to earn money from the ads displayed on your videos via Google adsense. Note : You can visit Google adsense terms and policies for displaying ads on your videos and regarding earning money via ads.

Powered by Blogger.

Android BroadcastReceiver – Tutorial


 Broadcast Receivers are used to respond to the other’s applications broadcast messages and messages are called Intents or Events. For Example , other applications in the android device can be informed via Broadcast messages that some of the data has been downloaded to the android device and is available to use for them , so in the meanwhile broadcast receiver will track down the message and will take down appropriate actions.


Steps for Evaluation

____________________________________________


Step 1 : Create a new project named as “com.YOUR_NAME.android.alarm” with the activity “Alarm-Activity“. Create the following layout.

____________________________________________


<?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">

<EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/time_sec" android:hint="Numbofsecs" android:inputType="numberDecimal"></EditText><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ok1" android:onClick="alert_start" android:text="Initiate Counter"></Button>

</LinearLayout>

____________________________________________


Step 2 : Now its time to create the below broadcast receiver class which will get the Vibrator service.

____________________________________________


package com.YOUR_NAME.android.alarm;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Vibrator;
import android.widget.Toast;

public class YourBroadcastReceiver extends BroadcastReceiver {
 @Override
 public void onReceive(Context context, Intent intent) {
  Toast.makeText(context, "Sorry ! your time is out.",
    Toast.LENGTH_LONG).show();
  // To vibrate the cellphone
  Vibrator vibrator_1 = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
  vibrator_1.vibrate(3000);
 }

}

____________________________________________


Step 3 : This class should be maintained like broadcast receiver within “AndroidManifest.xml” and vibration authorization should be allowed.

____________________________________________


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.YOUR_NAME.android.alarm" android:versionCode="1"
 android:versionName="1.0">
 <application android:icon="@drawable/icon" android:label="@string/app_name">
  <activity android:name=".Alarm-Activity" android:label="@string/app_name">
   <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
  </activity>
  <receiver android:name=".YourBroadcastReceiver" android:enabled="true">
  </receiver>
 </application>
 <uses-sdk android:minSdkVersion="8" />

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

____________________________________________


Step 4 : Its time to create your Main Activity which will create an intent for Broad-Cast-Reciever in order to get reciever Alarm-Manager Service .

____________________________________________



package com.YOUR_NAME.android.alarm;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class Alarm-Activity extends Activity {

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
 }

 public void alert_start(View view) {
  EditText text_1 = (EditText) findViewById(R.id.time_sec);
  int integer = Integer.parseInt(text_1.getText().toString());
  Intent intent_1 = new Intent(this, YourBroadcastReceiver.class);
  PendingIntent pending_Intent = PendingIntent.getBroadcast(
    this.getApplicationContext(), 234324243, intent_1, 0);
  AlarmManager alarmManager_1 = (AlarmManager) getSystemService(ALARM_SERVICE);
  alarmManager_1.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
    + (i * 1000), pending_Intent);
  Toast.makeText(this, "Set in Alarm  " + integer + " secs",
    Toast.LENGTH_LONG).show();
 }

}

____________________________________________


- Reference: You can also find the same blog content here at my other official blog http://baidartuts.altervista.org/android-broadcastreceiver-tutorial
  • Blogger Comments
  • Facebook Comments
Item Reviewed: Android BroadcastReceiver – Tutorial Description: Rating: 5 Reviewed By: Unknown