Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Thursday, March 12, 2015

Building a Meeting Scheduler for Android using the new Calendar API

Though developers are quite comfortable thinking in abstractions, we still find a lot of value in code examples and fully developed sample applications. Judging by the volume of comments, tweets, and git checkouts of the Au-to-do sample code we released a few weeks ago, our readers agree.

For Google Apps API developers who want to get started writing mobile apps, here’s a great new resource: a sample application that integrates Google Calendar API v3 with Android and illustrates best practices for OAuth 2.0. This meeting scheduler app built by Alain Vongsouvanh gets the user’s contact list, lets users select attendees, and matches free/busy times to suggest available meeting times. It provides a simple Android UI for user actions such as attendee selection:


The sample code for Meeting Scheduler demonstrates many key aspects of developing with Google Apps APIs. After authorizing all required access using OAuth 2.0, the Meeting Scheduler makes requests to the Calendar API. For example, the class FreeBusyTimesRetriever queries the free/busy endpoint to find available meeting times:


FreeBusyRequest request = new FreeBusyRequest();

request.setTimeMin(getDateTime(startDate, 0));
request.setTimeMax(getDateTime(startDate, timeSpan));

for (String attendee : attendees) {
requestItems.add(new FreeBusyRequestItem().setId(attendee));
}
request.setItems(requestItems);

FreeBusyResponse busyTimes;
try {
Freebusy.Query query = service.freebusy().query(request);
// Use partial GET to retrieve only needed fields.
query.setFields("calendars");
busyTimes = query.execute();
// ...
} catch (IOException e) {
// ...
}

In this snippet above, note the use of a partial GET request. Calendar API v3, along with many other new Google APIs, provides partial response with GET and PATCH to retrieve or update only the data fields you need for a given request. Using these methods can help you streamline your code and conserve system resources.

For the full context of all calls that Meeting Scheduler makes, including OAuth 2.0 flow and the handling of expired access tokens, see Getting Started with the Calendar API v3 and OAuth 2.0 on Android. The project site provides all the source code and other resources, and there’s a related wiki page with important configuration details.

We hope you’ll have a look at the sample and let us know what you think in the Google Apps Calendar API forum. You’re welcome to create a clone of the source code and do some Meeting Scheduler development of your own. If you find a bug or have an idea for a feature, don’t hesitate to file it for evaluation.


Eric Gilmore  

Eric is a technical writer working with the Developer Relations group. Previously dedicated to Google Enterprise documentation, he is now busy writing about various Google Apps APIs, including Contacts, Calendar, and Provisioning.

Wednesday, February 4, 2015

WORLD CUP 2014 Live Streaming with Android App

WORLD CUP 2014

Live Streaming with Android App 

Watch Live World Cup 2014  Fifa


FIFA World Cup 2014 Brazil

Did you Miss the Fifa world cup 2014 football match while on working or driving ? It is very difficult for the soccer lovers ,football fans to miss the single match of football world cup 2014 brazil. Android wont let you miss the single fifa world cup 2014 match as Android is participated and celebrating world cup brazil with its lovers and customers. World Cup 2014 is famous Android app to Watch Live world cup 2014 when you are not on TV. World Cup 2014 Android app provide you complete free live streaming  world cup 2014 matches so football lover will not miss any world cup match . Live Commentary ,Goals status , Live update about your favourite football team.This App is compatible with tablets and smartphones

App Features :


FIFA World Cup 2014 Brazil

 You can see World Cup 2014 Groups and their ranking. 



FIFA World Cup 2014 Brazil

FIFA World Cup 2014 Schedule and Match Time. 


FIFA World Cup 2014 Brazil

FIFA World Cup 2014 Brazil Point Table for all the soccer teams.



FIFA World Cup 2014 Brazil

Football World Cup 2014 predict and win prizes. 

Installation :

apk Size: 6.2 MB
Version: 1.1
Android OS: 4.0 and Above
Developers: GZ Systems Ltd.
Play Store Rating :4.5
Live World Cup 2014 App Download

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!

Monday, February 2, 2015

Android php web service client

In this post Im going to show you how we can access a very simple php web service from an Android application.
You can host your web service on wamp server installed in your machine or you can simply use a cloud server like 000webhost.

1. To keep things simple Im going to use a dummy php code as follows
    <?php
        echo "Hello world!!!!"
  ?>
Create this php file and copy it in to www directory of wamp server or upload it in to a cloud server.

2. Here is the code for Android activity
import android.app.Activity;
import android.os.Bundle;
import java.io.IOException;
import android.widget.TextView;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

public class AndroidWebActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.codeincloud.tk/First.php");
try {
HttpResponse response = httpclient.execute(httppost);
final String str = EntityUtils.toString(response.getEntity());
TextView tv = (TextView) findViewById(R.id.textView1);
tv.setText(str);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

Note : If you are using wamp server dont use local host for the url in line 18, use 10.0.2.2.
           Eg: http://10.0.2.2/android_connect/first.php
Dont forget to add internet permission.
Output of the program :

Saturday, January 31, 2015

ONDA V701 Dual Core Android Tablet V2 1 Firmware

ONDA V701 Dual Core Android Tablet Firmware 

V2.1 Firmware .

Compatible with ONDA V701 V5 Version Tablets. 




CPU: Amlogic 8726-MX

This firmware is only compatible with ONDA V701 V5 version tablets. If you try it on other ONDA tablets result might be incompatible or soft broken tablets. 

How to Check ONDA V701 Version for Firmware compatibility. 

before restoring you must see 9th and 10th digit on the back cover of tablet ,as showing in  image. The 9th and the 10th words are you tablet Version. 9th and 10th word of serial number of ONDA V701 Tablet show the version of tablet


Firmware Update for ONDA V701.

Download Amlogic Usb Burning Tools
see video tutorial how to use Amlogic burning tools 
A very nice effort by Valkoz for creating tutorial
Download Firmware



Step By Step flashing tutorial with images  for Amlogic Usb Burning Tools will be updated soon. 

ONYO Exceed 32 GB 9 7 Android Tablet Firmware





ONYO Exceed 32 GB 9.7

click here to download.

Friday, January 30, 2015

REPLICA ISLAND ANDROID FULL GAME

REPLICA ISLAND


Replica Island

DOWNLOAD FREE GAME