I have installed Android Lollipop on my Nexus 4 yesterday.. Today while chatting , suddenly my phone got hanged.. I have Screen lock set with Pattern.. After few seconds screen got locked.. Whenever i am trying to unlock i see following screen.. None of the buttons were working.. In nexus 4 you cant remove battery very easily and power off button also not working.. It was a complete deadlock..

Suddenly i got an Idea.. I connected my nexus to my Laptop using USB cable.. Opened Up Android Studio.. then Opened up Adb Terminal.. Ran Reboot command from Adb shell.. Finally i could reboot my nexus 4..

In this is the basic step to implement paging concept in ListView .We can say dynamic loading of element. ListView is very useful and powerful view in android.So this will help you a lot.In this tutorials you see how to parse JSON data from REST API & then showing in ListView dynamically .

I have explained how to open one activity from another activity on button click in an earlier post. This post is just an extension of that tutorial which shows how to send value from one activity to another activity in Android. As you have seen, we can easily open one activity from another using Android intent. To send some extra message, it again is the Android intent that would help us.

First, take an Android edittext in your layoutOne and get the value to a string variable in the layoutOne’s java page(inside the openNewActivity method of course.). Then add the value to the intent using putExtra method. Now call the second activity. See the code below:

public void openNewActivity(View view) {

// Do something in response to button Intent intent = new Intent(this, LayoutTwoActivity.class);

//get the value of the editText, convert it to string and store it in a string variable EditText editText = (EditText) findViewById(R.id.myEditText); String message = editText.getText().toString();

intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent);

}

You also need to add the definition of the EXTRA_MESSAGE variable at the beginning of the class like,

Inside the second layout, take a textview. Now, all you need to do is to get the value from the intent and set the value to the textview. We are going to do it inside the onCreate method of Course. See the code below:

Frankly speaking, flexi-auth library doesn’t allow us to add additional emails to the user accounts. So, in order to do that within your codeigniter app you have to write your own methods within the flexi-auth library files.

Alright, first let’s say we’ve a controller method ‘addEmail’ which adds emails to the user accounts as follows:

// if found the email is available then insert the newly added email to the corresponding table.

return $this->db->insert(‘secondary_email’, $data);

}

}

}

Now, send an email to the newly added email with a confirmation token,a redirective activation link and the corresponding user-id of the user. In order to do that, just add a method ‘addNewEmail_Patient’ to the ‘auth_model’ in the flexi-auth library:

function addNewEmail_Patient($email_to, $activation_token)

{

// The ‘update_email_via_verification()’ function generates a verification token that is then emailed to the user.

After the user gets the activation email of the newly added email he/she will click the activation link provided by the mail that activates the added email.
To do this, just add another method,’activate_new_email’ in the ‘patient’ controller next to the ‘addEmail’ method given at the top:

function activate_new_email($user_id, $confirmToken)

{

//check Token the current user details

$current_user_id = $this->flexi_auth->get_user_by_id()->result();

$currentuserid= $current_user_id[0]->uacc_id;

if($user_id == $currentuserid )

{

// if current user is logged-in then then check the token after checking it will redirect to patient home page

$this->patient_model->getToken($user_id, $confirmToken);

redirect(‘patient’);

}else

{

//it not it will redirect to login page.

redirect(‘auth/login’);

}

}

Now go to the ‘patient_model’ and add the following method to get the token and match it with the database table,if it has been matched successfully then ‘active’ field of the database table will be updated with the value ‘1’ and otherwise it’ll be redirected to the corresponding homepage. :

One last thing to remember that to add a new email to the user accounts you have to create an additional table other than the default flexi-auth ‘user-accounts’ table. We’ve named that as ‘secondary_email’ here. Nevertheless, we’re generating the approval token from flexi-auth and matching it with the default flexi-auth ‘user-accounts’ table data and we’re checking the email availability with flexi-auth too.

When retrieving the newly added email to show to the user on the webpage we’re getting it from the secondary_email table where the active column is set to ‘1’.

To develop with Windows Live Messenger Connect, you must register and obtain a client ID.

All programmatic interaction with Windows Live requires a client ID, which uniquely identifies your application to Windows Live. Your application must include the client ID in every request that it sends to the Messenger Connect API Service.

Before you register

To get ready to register, you must:

Decide which application type you want. If you are going to try both web and desktop applications, you must obtain two separate client IDs. (Sample Messenger Connect web and desktop applications are available.

Obtain a Windows Live ID, which you must have to be able to get a client ID for your application. If you don’t already have a Windows Live ID, the registration process guides you in creating one.
The client ID that you obtain is associated with the specific Windows Live ID that you use during registration, and this association cannot be changed later. We recommend that you create a new Windows Live ID specifically for managing your Windows Live application.

If you are a returning user, you see a page that lists your registered applications. Click Add an application on this page.

If you are new to the site, you see a page similar to following.

Type an application name (for example, “Contoso”). This is the name that users will see in the Windows Live user interface (UI). The application name should include your company name or the name of your web site.

Select an application type from the options that appear next to Application type. For more information, such as Web Application or Desktop Application

Provide the following information, depending on the application type you choose:

Web application—Provide the domain of your site. You cannot change this domain later. Do not specify a domain that is used for redirection.
Note that you can create a callback URL in a subdomain of the domain that you registered, for example, http://mysubdomain.contoso.com. This practice is called subdomain wildcarding, and it is enabled by default for all applications.
If you have multiple domains, you must register separate applications—one for each domain. If you have one domain with subdomains, you can either register separate applications for each subdomain, or register one application that uses the root domain and then use the same client ID on subdomains. When you register multiple applications, each application has its own name and logo.

Activity feed—This application type is available only to specific Windows Live partners.

Desktop application—Provide the home page URL at which your users can learn more—for example, a page that contains download instructions. You cannot change the domain of the home page URL later. Do not specify a domain that is used for redirection.

Click I accept to accept the Windows Live Terms of Service. This action registers your application. The next screen, shown in the following image, displays the client ID and secret key values for your application. Make a note of these values, because you will need them when you write your application.

// Check if the authorization code is received or not !
// Also, if the access token is received or not
if (!isset($_REQUEST['code']) && !isset($_SESSION['access_token'])) {
// Print the below message, if the code is not received !
echo “<br/><br/>”;
echo ‘<center><a href = “https://login.live.com/oauth20_authorize.srf?client_id=’.$client_key.’&scope=wl.basic+wl.emails&response_type=code&redirect_uri=’.$redirect_uri.’”><img src=”windows.png”/></center></a>’;

Those who have been using Astrid for long time like me, it is obviously a bad news for them. Astrid is going to close there service from 5th August 2013.

Today i got an EMail from Jon Paris & the Astrid Team, 660 4th Street #259, San Francisco, CA, 94107 and shocked after reading the content. They are suggesting to download the user data from Export Astrid before 5th August.

While creating a new activity, we are given a check box to make it the launcher activity. The first activity on an Android project by default becomes the launcher activity. But, to change the launcher activity manually ? To do that, we need to open the AndroidMainfest.xml file located in the root folder of the project.

First, download an example. My example project contains two activities. See the AndroidMainfest.xml file of the project:

As you can see, there are two activity tags. Whenever a new activity gets created, some information on that activity is stored inside the AndroidMainfest.xml file. Out of them, only one contains the categoty_launcher intent filter that makes that particular activity the launcher activity. The code is highlighted above.

To change your launcher activity, you can simply cut and paste the highlighted code inside the activity tag want to make the launcher activity. If no activity contains that code, the project will not get launched and you will get the following error:

Go through my previous post on Android to learn how to create Android activity. After that, create an new Android project along with the launcher activity. Name the layout of the activity, layout_one. See the following image:

Take a button inside the layout_one. To do that, copy the following code in your layout:

See the bold line in the button’s xml code, you must give a new and meaningful name to the android:onClick property. That name is the same name of the method which will be executed when the button is clicked. Now, open the activity of the layout and copy the below code just after the onCreate method (you can delete the onCreateOptionsMenu method as we do not need that in this tutorial)

public void openNewActivity(View view) {
// Do something in response to button

}

As, you can see, the name of the method is same as mentioned earlier. Now, whatever logic we write inside this method will be executed when the button is clicked. In this case, we want to open or start a new activity when the button is clicked. So, we need to create a new activity first. Create a new Android activity and name the activity and layout the following:

Take a TextView inside the activity and make its text, “Layouttwo“. After that, you have to add two lines inside the openNewActivity method to start the newly created activity:

The two lines are highlighted in bold. Intent is an object that most of the times is used to start a new activity. I have mentioned the name of the activity that should be started at the first line. Now run the project and click on the button and you will see that the second activity gets launched.

I have installed a new application in my Nokia Lumia 520 Windows 08 Phone that allows users to set music timer. It could be quite handy when we listen to music after going to bed. We often go to sleep and forget to stop music in our mobile phones. So, we could decide how long the music player will keep on playing music. To do that, you need to install an application called Ultra Tool. Open the application and select the inbuilt music player of the application, (marked by arrow in the left top row of the below screenshot ) then start a new song.

Then, you can click on stopmusic tile to stop the music immediately. Or you could open musictimer and then provide a number (minutes) to make the music stop exactly after that time.

You need to keep the option on foreground to keep it working. You could lock the screen as well. The inbuilt music player or Nokia Music could also be stopped by this application.

Ultra Tool contains other cool features as well, I will provide a complete review of those features in my next post on Windows 08 Phone applications.

This post shows how to create a new activity and how to change its content. An activity is a .java file which has a layout as its content, in other words, when an activity is launched, it simply shows its layout to the user. While creating a new project, we can create a new activity and its layout as well. Create a new Android project and do not change the default name of the activity and its layout.

Now, see the package explorer: there is one activity (launcher activity) inside the src folder and one layout (activity_main.xml) inside the res/layout folder.

Inside the layout (Android xml file) I have taken a TextView that contains “Layout activity_main.xml” as its android:text.

The onCreate method is a system defined method which contains all the codes to be executed when the activity gets created or launched. The bold line in the code sets the content of the page, in this case that is activity_main.

Now, if you launch the application, you will see the following output:

Now, add a new layout by right clicking on the layout folder selecting, New – AndroidXMLFile.

Then, name it, second_layout. and click Finish. The newly created xml file appears in the layout folder. Take a TextView inside it with some text (I gave Layout second_layout).

Replace the following line inside the MainActivity.java

setContentView(R.layout.activity_main);

with the below line:

setContentView(R.layout.second_layout);

You can launch the project and you will see that the output is changed and it is showing: Layout second_layout

You can add a new activity that will create its layout or xml file automatically. To do that, Right click on the project name and from there, choose: New – Others – Android – Android Activity.

Or you can create a .xml file and a Java class differently in the layout folder (xml file) and inside a package at src folder (.java file). Then, inside the java file, you can add the onCreate method containing a setContentView method that points to your newly created xml file.

My next post on Android shows how to open a new Android activity from another activity on clicking a button.