Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Wednesday, February 4, 2015

How to Install Windows 8 in Urdu Hindi Tutorial


How to Install Windows 8 in Urdu & Hindi Tutorial

Windows 8

Windows 8 is Microsofts latest operating system that combines the tablet Modern UI interface with the traditional Windows desktop.



Overview:

With this trial of Windows 8, users have an opportunity to test a slick and solid operating system that promises to revolutionize the way you do everything, from browsing the web to viewing multimedia files.

This is the most ambitious operating system that Microsoft has ever created. By blending both a tablet interface and a traditional desktop interface, Microsoft hopes that Windows 8 can please everyone. But can it? Lets find out.



Modern Interface:
                
As seen in the numerous preview versions, the Windows 8 interface is one of the largest changes to the Windows operating system. Every app you install on the new Modern interface is shown in multiple colored squares on your screen. Each square acts as a shortcut to open the program or the corresponding directory. Each panel is also fully customizable, so you can group apps together.




New features Flash:

The use of Flash in Windows 8 is one of the primary updates. Working together, Microsoft and Adobe have created a situation-specific version of Flash that works with Internet Explorer 10. This ensures Flash will run when you want it do, such as during video play-back, but wont affect your PCs performance or battery life by running when unnecessary. This is especially important for Windows RT users who value battery life and performance on the go.





New apps:

There are also quite a few Windows Store expansions when it comes to apps included natively in the Modern interface. Bing has added apps for travel, sports and news, for example. There are also, of course, existing Modernapps that were released in conjunction with Windows 8. Some of these include Weather, Maps and Finance.




Surfing the web:
                 
Windows 8 ties up a lot of loose ends in terms of stability issues seen in its preview versions. There is also a new feature users can look forward to called Flip ahead, IE which uses crowd-sourcing to determine what web page youre the most likely to click on next during your web browsing. To advance, all you have to do is swipe the screen if you have touch screen capabilities or click the forward arrow onscreen to get to the next page. This feature works while searching Bing, of course, but is also compatible with other search engines, so long as youre using Internet 



Windows 8: system requirements:

  • Processor  1GHz or faster
  • RAM  1GB (32bit) or 2GB (64bit)
  • Hard disk space  16GB (32bit) or 20GB (64bit)
  • Graphics card  Microsoft DirectX 9 graphics device or higher


Download Windows 8




☺ Video Tutorial ☺






Tuesday, February 3, 2015

Android beginner tutorial Part 72 Editing contacts

In this tutorial well make it possible to select and edit contacts in the database.

First of all, declare 2 new variables - editDialog and cursor:

private AlertDialog editDialog;
private Cursor cursor;

Now go to updateList() and instead of declaring a new Cursor each time, reuse the cursor variable:

public void updateList(){
String[] columns = new String[] {myDbHelper._ID, myDbHelper.NAME, myDbHelper.PHONE};
ContentResolver resolver = getContentResolver();
cursor = resolver.query(CONTENT_URI, columns, null, null, null);

final ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.customrow, cursor, new String[] {myDbHelper.NAME, myDbHelper.PHONE}, new int[] {R.id.t_name, R.id.t_phone}, 0);
ListView list = (ListView)findViewById(R.id.contactList);
list.setAdapter(adapter);
}

Another change well make is move all the code that creates the "Add contact" dialog into the dialogAdd() function:

public void dialogAdd(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
alertView = inflater.inflate(R.layout.add_window, null);
builder.setView(alertView);

builder.setTitle("Add contact");

builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
String new_name = t_name.getText().toString();
String new_phone = t_phone.getText().toString();
ContentValues values = new ContentValues();
values.put(myDbHelper.NAME, new_name);
values.put(myDbHelper.PHONE, new_phone);
getContentResolver().insert(CONTENT_URI, values);
updateList();
}
});

builder.setCancelable(true);
addDialog = builder.create();

addDialog.show();
}

Now go to onCreate() function and add an OnItemClickListener listener to our list. Call dialogEdit() function when an item is selected. It is important to pass 2 values as parameters to that function, those are the position and id of the current item.

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ListView list = (ListView)findViewById(R.id.contactList);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
dialogEdit(position, id);
}
});

updateList();
}

Create the dialogEdit() function. Create an AlertDialog just like it was done with the "Add contact" window. Instead of using the insert() method of your ContentResolver, use update(). Moreover, we need to set the default values of the text fields when the window is opened. This can be done using the position value we receive as one of the parameters and the cursor object:

public void dialogEdit(final int position, final long id){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
alertView = inflater.inflate(R.layout.add_window, null);
builder.setView(alertView);

builder.setTitle("Edit contact");

builder.setPositiveButton("Save", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
String new_name = t_name.getText().toString();
String new_phone = t_phone.getText().toString();
ContentValues values = new ContentValues();
values.put(myDbHelper.NAME, new_name);
values.put(myDbHelper.PHONE, new_phone);
getContentResolver().update(CONTENT_URI, values, myDbHelper._ID+"="+id, null);
updateList();
}
});

builder.setCancelable(true);

EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
cursor.moveToPosition(position);
t_name.setText(cursor.getString(1));
t_phone.setText(cursor.getString(2));

editDialog = builder.create();
editDialog.show();
}

Full code so far:

package com.kircode.codeforfood_test;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;

public class MainActivity extends Activity{

private static final Uri CONTENT_URI = Uri.parse("content://com.kircode.codeforfood_test.mycontentprovider/contacts");
private static final int IDM_ADD = 101;

private AlertDialog addDialog;
private AlertDialog editDialog;
private View alertView;
private Cursor cursor;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ListView list = (ListView)findViewById(R.id.contactList);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
dialogEdit(position, id);
}
});

updateList();
}

@Override
public boolean onCreateOptionsMenu(Menu menu){
menu.add(Menu.NONE, IDM_ADD, Menu.NONE, "Add");
return(super.onCreateOptionsMenu(menu));
}

@Override
public boolean onOptionsItemSelected(MenuItem item){
switch(item.getItemId()){
case IDM_ADD:
dialogAdd();
break;
}
return(super.onOptionsItemSelected(item));
}

public void dialogAdd(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
alertView = inflater.inflate(R.layout.add_window, null);
builder.setView(alertView);

builder.setTitle("Add contact");

builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
String new_name = t_name.getText().toString();
String new_phone = t_phone.getText().toString();
ContentValues values = new ContentValues();
values.put(myDbHelper.NAME, new_name);
values.put(myDbHelper.PHONE, new_phone);
getContentResolver().insert(CONTENT_URI, values);
updateList();
}
});

builder.setCancelable(true);
addDialog = builder.create();

addDialog.show();
}

public void dialogEdit(final int position, final long id){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

LayoutInflater inflater = LayoutInflater.from(getApplicationContext());
alertView = inflater.inflate(R.layout.add_window, null);
builder.setView(alertView);

builder.setTitle("Edit contact");

builder.setPositiveButton("Save", new DialogInterface.OnClickListener() {

@Override
public void onClick(DialogInterface dialog, int which) {
EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
String new_name = t_name.getText().toString();
String new_phone = t_phone.getText().toString();
ContentValues values = new ContentValues();
values.put(myDbHelper.NAME, new_name);
values.put(myDbHelper.PHONE, new_phone);
getContentResolver().update(CONTENT_URI, values, myDbHelper._ID+"="+id, null);
updateList();
}
});

builder.setCancelable(true);

EditText t_name = (EditText)alertView.findViewById(R.id.inp_name);
EditText t_phone = (EditText)alertView.findViewById(R.id.inp_phone);
cursor.moveToPosition(position);
t_name.setText(cursor.getString(1));
t_phone.setText(cursor.getString(2));

editDialog = builder.create();
editDialog.show();
}

public void updateList(){
String[] columns = new String[] {myDbHelper._ID, myDbHelper.NAME, myDbHelper.PHONE};
ContentResolver resolver = getContentResolver();
cursor = resolver.query(CONTENT_URI, columns, null, null, null);

final ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.customrow, cursor, new String[] {myDbHelper.NAME, myDbHelper.PHONE}, new int[] {R.id.t_name, R.id.t_phone}, 0);
ListView list = (ListView)findViewById(R.id.contactList);
list.setAdapter(adapter);
}

}

Thanks for reading!