One place for android professionals and hobyists. Get access to the latest news, tutorials, tips, FAQs on android development and information about great android apps.
Sunday, December 26, 2010
Android-based Tablet: Samsung Galaxy Tab
Samsung Galaxy Tab is a handy, powerful, light-weight android tablet with rich features that people find fun and useful to carry with while on the move! I hope such a tablet and others will soon be popular in Karachi and then in other cities of Pakistan as well. Tablets and smartphones will be a blessing as the corporate institutions will not have to put their personal PCs on a standby UPS thus saving time, hassle and ultimately cost.
Mobilink Launched Samsung Galaxy Tab For Rs.59,000 - http://www.pak-sms.com/mobilin k-launched-samsung-galaxy-tab- for-rs-59000-1490
Mobilink Launched Samsung Galaxy Tab For Rs.59,000 - http://www.pak-sms.com/mobilin
Saturday, December 18, 2010
Friday, December 17, 2010
Thursday, December 16, 2010
Tuesday, December 14, 2010
Friday, December 10, 2010
Introducing Android 2.3
Here are the highlights of the platform's features on the official android website: http://developer.android.com/sdk/android-2.3-highlights.html
Tuesday, November 30, 2010
Monday, November 29, 2010
Thursday, November 25, 2010
Wednesday, November 24, 2010
Tuesday, November 23, 2010
Sunday, November 14, 2010
Saturday, November 6, 2010
App Inventor: A great IDE for Android
Many times when one has to work under a tight deadline and have to design petty interfaces, it becomes too tedious to write XML layouts.App Inventor is a convenient tool to design user-interface in a much lesser time span. It could be useful for novice developers who have a little or no exposure to Android development. And UI designing is not all, with App Inventor developers can incorporate Media, Animation, Social and Sensor features in their apps.
App Inventor is in it's Beta. For more information here is the official link:
http://appinventor.googlelabs.com/about/
App Inventor is in it's Beta. For more information here is the official link:
http://appinventor.googlelabs.com/about/
Thursday, November 4, 2010
Wednesday, November 3, 2010
Monday, October 25, 2010
Some Latest Stats about Android Apps
Saturday, October 23, 2010
Text To Speech Example In Android
I had the opportunity to incorporate Text To Speech feature in E-Book apps in Android at Salsoft Technologies for Feel Social.Here is a neat example how to use the android.speech.tts.TextToSpeech
library.
Take an Edit Text Box and a Button and run the following code and feel free to leave your comments:
package az.tts;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class TexttoSpeech extends Activity implements OnInitListener {
/** Called when the activity is first created. */
private EditText text;
private TextToSpeech tts;
private String str="";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
text = (EditText) findViewById(R.id.EditText01);
//text.setText("Press me");
str = text.getText().toString();
Button btn = (Button)findViewById(R.id.Button01);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
str = text.getText().toString();
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onInit(int status) {
// TODO Auto-generated method stub
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
}
library.
Take an Edit Text Box and a Button and run the following code and feel free to leave your comments:
package az.tts;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class TexttoSpeech extends Activity implements OnInitListener {
/** Called when the activity is first created. */
private EditText text;
private TextToSpeech tts;
private String str="";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
text = (EditText) findViewById(R.id.EditText01);
//text.setText("Press me");
str = text.getText().toString();
Button btn = (Button)findViewById(R.id.Button01);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
str = text.getText().toString();
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onInit(int status) {
// TODO Auto-generated method stub
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
}
Thursday, October 14, 2010
FunBalls – Funny Android Balls
The game has two modes
-’Lines’ mode: Arrange the colored balls into lines of the same color and gain the score.
-’Block’ mode: Arrange the colored balls into square 2×2 balls of the same color and gain score.
Go to setting to change game speed.
Warning: Change settings, change game mode will cause the game reload!
Version 0.9.0:
- First release!
Tuesday, October 12, 2010
Wednesday, September 29, 2010
Synerzip, a leading software product development firm, has announced a partnership with Quickoffice to develop a series of office productivity applications for Android. The company cites Android’s open platform, and appeal to both consumer and business users, as a key reason for the partnership. Hemant Elhence, Founder and CEO of Synerzip, had the following to say:
“While Synerzip has been assisting its clients for the last several years in building mobile applications on various mobile platforms including Windows Mobile, Windows CE, Android, iPhone, BlackBerry, Symbian and Palm, we believe the Quickoffice partnership will maximize our focus on mobile application development with particular emphasis on the Android platform.”
No announcement was made regarding the exact number or nature of these office applications, nor was a time frame for their release given. Continue after the break for the full presser.
DALLAS, Sept. 29 /PRNewswire/ — Synerzip, a leading dual-shore Agile software product development partner for small to midsized, typically venture funded technology companies, announced today that it has partnered with Quickoffice to build a portfolio of office productivity applications for the Android platform.
Android, the first truly open and comprehensive platform for mobile devices developed by Google and the Open Handset Alliance, is the hottest new platform for mobile application development. Unlike BlackBerry which largely appeals to corporate users and iPhone which is largely consumer focused, Android promises to appeal to both consumer and corporate users. Android operating systems will be available on a broad range of devices including, mobile phones, netbooks and tablet PCs. This broad applicability of Android OS makes it an attractive platform for building end user applications.
“While Synerzip has been assisting its clients for the last several years in building mobile applications on various mobile platforms including Windows Mobile, Windows CE, Android, iPhone, BlackBerry, Symbian and Palm, we believe the Quickoffice partnership will maximize our focus on mobile application development with particular emphasis on the Android platform,” saidHemant Elhence, Founder and CEO of Synerzip.
David Halpin, Quickoffice’s VP of Engineering noted, “The Quickoffice team has broad and deep expertise in building productivity applications on all mobile platforms. Given the strong demand for our products, last year we started looking for a software development partner who could help us significantly expand our development capacity in a capital efficient manner, without compromising quality and time to market.” David added, “We are very pleased with the caliber and quality of the Synerzip team. We found Synerzip’s expertise in Agile software development practices combined with their solid experience in the mobile/Android platform a perfect match for Quickoffice.”
Hemant observed, “The Quickoffice partnership will help us accelerate the development pace on the Android platform allowing us, through our Agile practices and offshore team, to develop new and compelling mobile applications for our clients rapidly and cost efficiently.”
About Quickoffice
Quickoffice is the world leader in providing mobile office productivity software and solutions for mobile devices. The company’s robust product suite includes its flagship smartphone office suite, Quickoffice® Premier, its Content Transformation Solution (CTS) infrastructure and the Bitflash® Rich Media Engine. Quickoffice Premier is an award-winning smartphone application that provides native viewing and editing of Microsoft® Office documents in over 47 languages. The software ships as an on-device solution on tens of millions of smartphone devices annually. The CTS client/server infrastructure offers network optimized, anytime, anywhere access to digital content and high-definition viewing of such content. The Bitflash Rich Media engine is the industry’s highest rated SVG-T engine providing rich user experiences on over 300M mobile devices worldwide. Platforms supported by Quickoffice include Symbian®, Palm®, BlackBerry®, iPhone® and Android. Privately held, Quickoffice Inc. is based in Dallas with offices in London, Ottawa, St. Petersburg, Russia, and Kharkiv, Ukraine. More information is available at www.quickoffice.com.
About Synerzip
Synerzip, based in Dallas, Texas, serves small/mid-sized companies with dual-shore (US + India based) Agile software product development and QA/testing services. Synerzip was founded in 2004 by a seasoned team of software professionals, who deeply understood the common pitfalls of software development. Synerzip helps its clients leverage the offshore advantage without the upfront risk, hassle factor, and set-up costs. Synerzip’s offshore development center is located in Pune, India. As a true partner, Synerzip allows its clients to take over its offshore team and turn it into their own captive operation. Synerzip’s clients include leading privately funded technology companies, such as 360Commerce, Traq Wireless, Credant Technologies, Servient, CMS Globalsoft, Skywire Software, Pavilion Technologies, Gimmal Group, PDX/Rx.com, ClearOrbit, UnWired Buyer, MediaCart, BarFly, NeoFirma, iTKO, eGistics, Quickoffice, etc.
Quickoffice is a trademark of Quickoffice, Inc. All other trademarks are property of their respective holders.
SOURCE Synerzip
Tuesday, September 28, 2010
Monday, September 27, 2010
Tuesday, September 21, 2010
Monday, September 20, 2010
Wednesday, September 15, 2010
Get-It-Done Guy's 9 Steps to Work Less and Do More book by Stever Robbins Social Media News Release
Get-It-Done Guy's 9 Steps to Work Less and Do More book by Stever Robbins Social Media News Release
Work related disorders like ADHD and interacting people at work effectively are a few of the most common issues one faces nowadays. A great book has just been released by Stever Robbins and i am waiting keenly to receive its free copy to write a review on it, and may be port it to our E-Book apps on Android!
Monday, September 13, 2010
Sunday, September 12, 2010
Wednesday, September 8, 2010
Friday, August 13, 2010
Listen to DROID X Q&A
Listen to internet radio with MOTODEV on Blog Talk Radio
Tuesday, August 3, 2010
Tutorial: Developing a Quiz App on Android
Recently, i had to integrate a quiz module in an e-book application.I would be glad to share my code along with the schema. Using SQLite, i have the following table definitions for my schema:
CREATE TABLE Quiz(Correct_Answer TEXT, Quiz_ID INTEGER PRIMARY KEY, Quiz_Text TEXT)
CREATE TABLE Answers(Answer TEXT, Answer_ID INTEGER PRIMARY KEY, Quiz_ID NUMERIC)
CREATE TABLE Android_Metadata("locale" TEXT DEFAULT 'en_US')
NOTE: Once created the database file is to be placed in the assets folder of the project.
In order to design the layout as shown in the picture above here is the code for main.xml:
main.xml
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
android:id="@+id/rdbGp1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_y="30dip"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
>
android:text="Save" android:id="@+id/btnSave" android:layout_width="100dip" android:layout_height="wrap_content" android:layout_x="50dip" android:layout_y="250dip">
android:layout_x="17dip"
android:layout_y="15dip"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:text="Question"
android:layout_height="wrap_content">
android:layout_x="100dip"
android:layout_y="320dip"
android:id="@+id/tvScore"
android:layout_width="wrap_content"
android:text="Score"
android:layout_height="wrap_content">
-
Here's my Database Helper containing all the methods necessary to create and the Quiz database and to query it afterwards:
DatabaseHelper.java
package com.myapps.quiz;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
public class DataBaseHelper extends SQLiteOpenHelper{
//The Android's default system path of your application database.
private static String DB_PATH = "/data/data/com.myapps.quiz/databases/";
private static String DB_NAME = "quiz";
private static String Table_name="Quiz";
private SQLiteDatabase myDataBase;
private SQLiteDatabase myData;
private final Context myContext;
/**
* Constructor
* Takes and keeps a reference of the passed context in order to access to the application assets and resources.
* @param context
*/
public DataBaseHelper(Context context) {
super(context, DB_NAME, null, 1);
this.myContext = context;
}
/**
* Creates a empty database on the system and rewrites it with your own database.
* */
public void createDataBase() throws IOException{
boolean dbExist = checkDataBase();
if(dbExist){
//do nothing - database already exist
}else{
CopyFiles();
}
}
private void CopyFiles()
{
try
{
InputStream is = myContext.getAssets().open(DB_NAME);
File outfile = new File(DB_PATH,DB_NAME);
outfile.getParentFile().mkdirs();
outfile.createNewFile();
if (is == null)
throw new RuntimeException("stream is null");
else
{
FileOutputStream out = new FileOutputStream(outfile);
// BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream(outfile));
byte buf[] = new byte[128];
do {
int numread = is.read(buf);
if (numread <= 0) break; out.write(buf, 0, numread); } while (true); is.close(); out.close(); } //AssetFileDescriptor af = am.openFd("world_treasure_hunter_deluxe.apk"); } catch (IOException e) { throw new RuntimeException(e); } } /** * Check if the database already exist to avoid re-copying the file each time you open the application. * @return true if it exists, false if it doesn't */ private boolean checkDataBase(){ SQLiteDatabase checkDB = null; try{ String myPath = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY); }catch(SQLiteException e){ } if(checkDB != null){ checkDB.close(); } return checkDB != null ? true : false; } /** * Copies your database from your local assets-folder to the just created empty database in the * system folder, from where it can be accessed and handled. * This is done by transfering bytestream. * */ private void copyDataBase() throws IOException{ //Open your local db as the input stream InputStream myInput = myContext.getAssets().open(DB_NAME); // Path to the just created empty db String outFileName = DB_PATH + DB_NAME; //Open the empty db as the output stream OutputStream myOutput = new FileOutputStream(outFileName); //transfer bytes from the inputfile to the outputfile byte[] buffer = new byte[1024]; int length; while ((length = myInput.read(buffer))>0){
myOutput.write(buffer, 0, length);
}
//Close the streams
myOutput.flush();
myOutput.close();
myInput.close();
}
public void openDataBase() throws SQLException{
//Open the database
String myPath = DB_PATH + DB_NAME;
myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
}
@Override
public synchronized void close() {
if(myDataBase != null)
myDataBase.close();
super.close();
}
@Override
public void onCreate(SQLiteDatabase db) {
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
/// Get Book content////////
public Cursor getQuiz_Content(int bookId)
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
Cursor cur;
cur=myData.rawQuery("select quiz_text from Quiz where quiz_id='"+bookId+"'",null);
cur.moveToFirst();
myData.close();
return cur;
};
//////////////////////////
/// Get Book content////////
public Cursor getQuiz_List()
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
int i;
Cursor cur;
cur=myData.rawQuery("select quiz_id,quiz_text,correct_answer from quiz",null);
cur.moveToFirst();
i = cur.getCount();
myData.close();
return cur;
};
//////////////////////////
public Cursor getAns(int quizid)
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
Cursor cur;
cur = myData.rawQuery("select answers from answer where quiz_id='"+quizid+"'", null);
cur.moveToFirst();
myData.close();
return cur;
}
public Cursor getAnsList()
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
Cursor cur;
cur = myData.rawQuery("select answers from answer", null);
cur.moveToFirst();
myData.close();
return cur;
}
public Cursor getCorrAns()
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
Cursor cur;
cur = myData.rawQuery("select correct_answer from quiz", null);
cur.moveToFirst();
myData.close();
return cur;
}
//---updates a title---
/* public boolean UpdateFavourite_Individual(long rowid,String fav)
{
String myPath = DB_PATH + DB_NAME;
myData = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
ContentValues args = new ContentValues();
args.put("bookmark", fav);
return myData.update("lyrics", args,
"rowid=" + rowid, null) > 0;
}*/
//////////////////
}
Here's the Quiz class to add the front-end functionality(like adding radio buttons and scoring functionality):
Quiz.java
package com.myapps.quiz;
import java.io.IOException;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
public class Quiz extends Activity{
/** Called when the activity is first created. */
private RadioButton radioButton;
private TextView quizQuestion;
private TextView tvScore;
private int rowIndex = 1;
private static int score=0;
private int questNo=0;
private boolean checked=false;
private boolean flag=true;
private RadioGroup radioGroup;
String[] corrAns = new String[5];
final DataBaseHelper db = new DataBaseHelper(this);
Cursor c1;
Cursor c2;
Cursor c3;
int counter=1;
String label;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
String options[] = new String[19];
// get reference to radio group in layout
RadioGroup radiogroup = (RadioGroup) findViewById(R.id.rdbGp1);
// layout params to use when adding each radio button
LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(
RadioGroup.LayoutParams.WRAP_CONTENT,
RadioGroup.LayoutParams.WRAP_CONTENT);
try {
db.createDataBase();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
c3 = db.getCorrAns();
tvScore = (TextView) findViewById(R.id.tvScore);
for (int i=0;i<=4;i++)
{
corrAns[i]=c3.getString(0);
c3.moveToNext();
}
radioGroup = (RadioGroup) findViewById(R.id.rdbGp1);
radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
for(int i=0; i
RadioButton btn = (RadioButton) radioGroup.getChildAt(i);
String text;
if (btn.isPressed() && btn.isChecked() && questNo < 5)
{
Log.e("corrAns[questNo]",corrAns[questNo]);
if (corrAns[questNo].equals(btn.getText()) && flag==true)
{
score++;
flag=false;
checked = true;
}
else if(checked==true)
{
score--;
flag=true;
checked = false;
}
}
}
tvScore.setText("Score: " + Integer.toString(score) + "/5");
Log.e("Score:", Integer.toString(score));
}
});
quizQuestion = (TextView) findViewById(R.id.TextView01);
displayQuestion();
/*Displays the next options and sets listener on next button*/
Button btnNext = (Button) findViewById(R.id.btnNext);
btnNext.setOnClickListener(btnNext_Listener);
/*Saves the selected values in the database on the save button*/
Button btnSave = (Button) findViewById(R.id.btnSave);
btnSave.setOnClickListener(btnSave_Listener);
}
/*Called when next button is clicked*/
private View.OnClickListener btnNext_Listener= new View.OnClickListener() {
@Override
public void onClick(View v) {
flag=true;
checked = false;
questNo++;
if (questNo < 5)
{
c1.moveToNext();
displayQuestion();
}
}
};
/*Called when save button is clicked*/
private View.OnClickListener btnSave_Listener= new View.OnClickListener() {
@Override
public void onClick(View v) {
}
};
private void displayQuestion()
{
//Fetching data quiz data and incrementing on each click
c1=db.getQuiz_Content(rowIndex);
c2 =db.getAns(rowIndex++);
quizQuestion.setText(c1.getString(0));
radioGroup.removeAllViews();
for (int i=0;i<=3;i++)
{
//Generating and adding 4 radio buttons dynamically
radioButton = new RadioButton(this);
radioButton.setText(c2.getString(0));
radioButton.setId(i);
c2.moveToNext();
radioGroup.addView(radioButton);
}
}
}
Subscribe to:
Posts (Atom)