Startup Weekend – Bangalore

Startup Weekend is coming to Bangalore! Startup Weekend is proud to announce that we will be holding our next event in March on the 11th to the 13th at the Microsoft Signature Building (Embassy Golf Links Business Park Intermediate Ring Road, Domlur). The event features attendees, speakers, mentors, and judges from within local entrepreneurial community. Participants come from diverse backgrounds such as design, business development, IT, coding and developing, legal, and marketing. Judges and interested mentor volunteers are drawn from the local community and are encouraged to offer advice and mentoring to the participants throughout the weekend and following the final presentations.
Register startup weekend
Over the course of 54 hours the teams go from a basic idea through the stages of business plan development and early deployment. Some teams are even able to create working versions of their website or smart phone application, all teams are able to learn from one another and leave the event knowing more about themselves than when they arrived. The final stage of the event occurs on Sunday night when the teams come together one final time to hear final presentations and receive feedback from the panel of judges. Prizes from local sponsors support the future efforts of the startup such as cash, donations of services or goods, and opportunities for further mentorship.

Startup Weekend: An Overview

Startup Weekend is a non-profit organization based out of Seattle, WA USA. We consist of a small full time staff of eight along with community leaders in cities all over the globe. Startup Weekend’s primary mission is to be the most valuable and influential organization in startup communities around the world. Startup Weekend doesn’t have to teach entrepreneurship in a boring classroom setting, we model it in a fun, interactive, and results driven way. As a result, we have become one of the leading catalysts for startup creation, co-founder dating, and entrepreneurship education in startup ecosystems around the world.

Registration: http://bangalore.startupweekend.org/tickets/


Insert and modify Contact in Android

Android 2.0 provides new Contact API, which is defined in  android.provider.ContactsContract.  After some try on contact api I found a better and easy solution for insertion and modification of contact.

Insert contact -

Intent addContactIntent = new Intent(Intent.ACTION_INSERT, ContactsContract.Contacts.CONTENT_URI);

addContactIntent.putExtra(ContactsContract.Intents.Insert.NAME,

"xyz");

addContactIntent.putExtra(ContactsContract.Intents.Insert.EMAIL,

"abc@gmail.com");

addContactIntent.putExtra(ContactsContract.Intents.Insert.PHONE,"012345678");

startActivity(addContactIntent);

ACTION_INSERT will start .EditContact activity.

Edit contacts -
  • If _ID of contact is known -

Intent intent = new Intent(Intent.ACTION_EDIT);

intent.setData(ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, _ID));

startActivity(intent);

  • If _ID of contact is not known -
i) Find out conatct _ID by phone number .
// CONTENT_FILTER_URI allow to search contact by phone number

Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(getPhone()));

// This query will return NAME and ID of conatct, associated with phone //number.

Cursor mcursor = getContentResolver().query(lookupUri,new String[] { PhoneLookup.DISPLAY_NAME, PhoneLookup._ID                    },null, null, null);

//Now retrive _ID from query result

long idPhone = 0;

try {
if (mcursor != null) {
if (mcursor.moveToFirst()) {
idPhone = Long.valueOf(mcursor.getString(mcursor .getColumnIndex(PhoneLookup._ID)));
Log.d("", "Contact id::" + idPhone);
}
}
} finally {
mcursor.close();
}

ii) Then Edit contact

if (idPhone > 0) {

Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setData(ContentUris.withAppendedId( ContactsContract.Contacts.CONTENT_URI, idPhone));
startActivity(intent);
} else {
Toast.makeText(getApplicationContext(), "contact not in list",
Toast.LENGTH_SHORT).show();
}

You can also search _ID by partial name, for this instead of PhoneLookup.CONTENT_FILTER_URI use ContactsContract.Contacts.CONTENT_FILTER_URI
To work with contact, you have to define special permission in AndroidManifest.xml .

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

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


Historical timeline charts related to computer/electronics

Android

iPhone

Apple

Mac

Bill Gates

Linux

Windows CE

Various Mobile OS

Excel

Photoshop

Intel

Sony

Nokia

Social Media

Search Engines

Programming Languages

W3C(Internet)

Game Technology

NFS Car Racing Game

CellPhone

Electronics

Universe(Space)

Software

Hardware


Request Class Details

For importing Request Class use following statement
use Symfony\Component\HttpFoundation\Request;

Following statement creates object of class “Request”
$request = Request::createFromGlobals();

// the URI being requested (e.g. /about) minus any query parameters
Every Index of $_SERVER global variable can be accessed using Request object with using get method
so for example to get $_SERVER['PATH_INFO'] using Request Object use following statement.

$request->getPathInfo();

// retrieve GET and POST variables respectively
$request->query->get(‘foo’);
$request->request->get(‘bar’);

// retrieves an instance of UploadedFile identified by foo
$request->files->get(‘foo’);

$request->getMethod(); // GET, POST, PUT, DELETE, HEAD
$request->getLanguages(); // an array of languages the client accepts

List of functions available in Request class can be accessed via following link\

http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Request.html

1 Comment more...

File size limit exceeded linux error

This error can be fixed by checking command uname -a.
Here it will display max limits assigned to various resources.
If even after assigning limits it is giving error it means one of your logs is having size which has exceeded the limit. Try by clearing your logs then everything must work fine.

1 Comment more...

Innovative Test Cases and Expected Results for Accelerometer, Compass And GPS

In current mobile technology, we use accelerometer, compass and GPS in latest mobile models. Here some innovative test cases and expected results of those components, when we test in some places like in the space, on any other planet, satellite, center of gravity of earth and center of magnetic field of earth. Those cases are discussed as following:

1. In space: In space, accelerometer, compass and GPS will not work. because accelerometer and compass have required gravity and magnetic field respectively. But when we use accelerometer and compass nearer any planet, then we get relative values as that planet’s field with some accuracy. and GPS will not work, if we are close to any other planet excluding earth. Because for GPS usage, we require human invented working satellites.

2. On any other planet (excluding earth): Still GPS will not work in any other planet. and we get relative values of accelerometer and compass as that planet.

3. On center of gravity of earth: We cannot predict results for accelerometer and GPS. It is possible that we get garbage values for accelerometer. and compass will work proper because location of center of gravity and location of center of magnetic field of earth are different.

4. On center of magnetic field of earth: In this case, we get garbage values for compass and get proper values for accelerometer and GPS. But still It is possible that if there is any relationship between gravity and magnetic field, then we get unknown results for accelerometer.

For all those cases, I expect results based on physics theories, but still we cannot guess exact results. Those all will work on so many parameters, planet atmosphere and other theories.

-Samir Solanki


Nine Patch Images useful for android

Android devices come in different screen sizes and density, often making it very difficult for developer to design an application for all screen sizes. Use of nine patch images can be very helpful for them. Mostly nine patch images are used as background for Buttons, Texts, Frames. Android provide a tool for creating nine patch images. It is available in android-sdk/tools directory named as draw9patch.
What is nine patch?
Nine patch images are simply PNG images with 9 patches as explained in figure -
1,3,7,9 – Not scalable area
2 – Horizontal scalable area
4 – Vertical scale area
6,8 – Text Area
For scaling purpose you have to give guideline for both area(2,4). Otherwise converted nine patch image will not be proper nine patch.
ex -
So basically the intersection of horizontal and vertical guideline’s pixels will replicate. Guidelines for text area is optional.
Nine patch images can not be scale down, so use of mdpi images are baseline for dp scaling(Ignoring ldpi). Here is a link to learn how to draw nine patch images- http://developer.android.com/guide/developing/tools/draw9patch.html

Batch Insert to SQLite database on Android

Database operations are slow and in a situation where thousands of records have to be inserted, inserting each record consumes a lot of time and affects the performance of the application. In such situations,batch insert saves some overhead. A significant amount of time can be saved if batch inserts are made in a single transaction.

SQLite provides three simple methods in SQLiteDatabase class :
beginTransaction();
setTransactionSuccessful();
endTransaction();

These methods can be used to make all the insert calls in the same batch in a single transaction. Transactions are used when there is a need to perform a series of queries that either all complete or all fail. When a SQLite transaction fails an exception will be thrown. Start a transaction by calling the beginTransaction() method. Perform the database operations and then call the setTransactionSuccessful() to commit the transaction. Once the transaction is complete call the endTransaction() function.

A sample example code is shown below:

// Begin the transaction
db.beginTransaction();
try{
for each record in the list{
ContentValues contentValues=new ContentValues();
contentValues.put(COLUMN_NAME,record);
db.insert(TABLE_NAME,null,contentValues);

}
// Transaction is successful and all the records have been inserted
db.setTransactionSuccessful();
}catch(Exception e){
Log.e(“Error in transaction”,e.toString());
}finally{
//End the transaction
db.endTransaction();
}


Customizing Background and Text color in Options Menu Android

Options menu in android can be customized to set the background or change the text appearance. The background and text color in the menu couldn’t be changed using themes and styles. The android source code (data\res\layout\icon_menu_item_layout.xml)uses a custom item of class “com.android.internal.view.menu.IconMenuItem”View for the menu layout. We can make changes in the above class to customize the menu. To achieve the same, use LayoutInflater factory class and set the background and text color for the view.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.my_menu, menu);

getLayoutInflater().setFactory(new Factory() {
@Override
public View onCreateView(String name, Context context,
AttributeSet attrs) {

if (name .equalsIgnoreCase(“com.android.internal.view.menu.IconMenuItemView”)) {
try {
LayoutInflater f = getLayoutInflater();
final View view = f.createView(name, null, attrs);

new Handler().post(new Runnable() {
public void run() {

// set the background drawable
view .setBackgroundResource(R.drawable.my_ac_menu_background);

// set the text color
((TextView) view).setTextColor(Color.WHITE);
}
});
return view;
} catch (InflateException e) {
} catch (ClassNotFoundException e) {
}
}
return null;
}
});
return super.onCreateOptionsMenu(menu);
}


How to change foreground & background colors in a webview.

At times we need to change the font or background color of the webview in Android to make it more readable or to conform to a design of your app. This post will show how simple it can be to almost always achieve the result. The latter is more simple as webview provides an API :

setBackgroundColor (int color)

What one must note is if the HTML contains a value for the background it will override the color we set. The same is true for the foreground color too.

For the foreground color we make use of CSS to set the color and add it to the content we want to display in a div element wrapping the html we need to display. Here is the sample code

private final String htmlbegin = "<div style=\"color:#FFFFFF ;  \">";
private final String htmlend = " </div>";
private final String htmlBody = "<p>Summary</p>"
	+ "<p>Strong text</strong> Somemore text"
	+ "and the final line</p>";
WebView body;

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

	body = (WebView) findViewById(R.id.message_body);
	body.setBackgroundColor(0);

	// body.setDef
	body.loadDataWithBaseURL("", htmlbegin + htmlBody + htmlend,
		"text/html", "utf-8", "");
}

As I stated before any css inside the html will override our css settings.


  • TechJini Solutions

  • © Copyright 2009 TechJini Solutions Private Limited. All Rights Reserved
    iDream theme by Templates Next | Powered by WordPress