techjini

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/


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.


Retrieving Current Network Status in Android

Here is a quick snippet of code which will help us in getting the current status of an Android device’s data connection.  We make use of the ConnectivityManager class to get current active network information. We try to catch a NullPointerException which is thrown by the isConnected method when there is no active data connection.

/**
 * Returns availability of a data connection
 * @param mContext
 *            Context of app
 * @return True is data connection is available , false otherwise
 */
public static boolean isDataConnectionOn(Context mContext) {
	ConnectivityManager connectionManager = (ConnectivityManager) mContext
			.getSystemService(Context.CONNECTIVITY_SERVICE);
	try {
		if (connectionManager.getActiveNetworkInfo().isConnected()) {
			Log.d("ConStatus", "Data Connection On");
			return true;
		} else {
			Log.d("ConStatus", "Data Connection off");
			return false;
		}
	} catch (NullPointerException e) {
		// No Active Connection
		Log.d("ConStatus", "No Active Connection");
		return false;
	}
}

To check whether an element exists using jQuery

To check whether element is present or not use following code in jQuery:-

If we use following code for checking tag it will always return true as
jQuery always returns object.

if($(‘checkbox’)){

}

Correct way to do this is as follows:-

if ($(‘checkbox’).length > 0) {

}


To get Linux OS release

To get Linux OS release, give either of the following commands

1.$ uname -r
2.$ cat /proc/version


Code for resumable download

Another piece of code for PHP developers, useful in open source development.

Following is the function for application that needs functionality of resumable download.

public static function dl_file_resumable($file, $is_resume=TRUE)
{
//First, see if the file exists
if (!is_file($file))
{
die(“404 File not found!“);
}

//Gather relevent info about file
$size = filesize($file);
$fileinfo = pathinfo($file);

//workaround for IE filename bug with multiple periods / multiple dots in filename
//that adds square brackets to filename – eg. setup.abc.exe becomes setup[1].abc.exe
$filename = (strstr($_SERVER['HTTP_USER_AGENT'], ‘MSIE’)) ?
preg_replace(‘/\./’, ‘%2e’, $fileinfo['basename'], substr_count($fileinfo['basename'], ‘.’) – 1) :
$fileinfo['basename'];

$file_extension = strtolower($path_info['extension']);

//This will set the Content-Type to the appropriate setting for the file
switch($file_extension)
{
case ‘zip’: $ctype=’application/zip’; break;
default: $ctype=’application/force-download’;
}

//check if http_range is sent by browser (or download manager)
if($is_resume && isset($_SERVER['HTTP_RANGE']))
{
list($size_unit, $range_orig) = explode(‘=’, $_SERVER['HTTP_RANGE'], 2);
if ($size_unit == ‘bytes’)
{
//multiple ranges could be specified at the same time, but for simplicity only serve the first range
//http://tools.ietf.org/id/draft-ietf-http-range-retrieval-00.txt
list($range_from, $extra_ranges) = explode(‘,’, $range_orig, 2);
}
else
{
$range_from = ”;
}
}
else
{
$range_from = ”;
}

//figure out download piece from range (if set)
list($seek_start, $seek_end) = explode(‘-’, $range_from, 2);

//set start and end based on range (if set), else set defaults
//also check for invalid ranges.
$seek_end = (empty($seek_end)) ? ($size – 1) : min(abs(intval($seek_end)),($size – 1));
$seek_start = (empty($seek_start) || $seek_end 0 || $seek_end < ($size – 1))
{
header(‘HTTP/1.1 206 Partial Content’);
}

header(‘Accept-Ranges: bytes’);
header(‘Content-Range: bytes ‘.$seek_start.’-’.$seek_end.’/’.$size);
}

//headers for IE Bugs (is this necessary?)
//header(“Cache-Control: cache, must-revalidate”);
//header(“Pragma: public”);

header(‘Content-Type: ‘ . $ctype);
header(‘Content-Disposition: attachment; filename=”‘ . $filename . ‘”‘);
header(‘Content-Length: ‘.($seek_end – $seek_start + 1));

//open the file
$fp = fopen($file, ‘rb’);
//seek to start of missing part
fseek($fp, $seek_start);

//start buffered download
while(!feof($fp))
{
//reset time limit for big files
set_time_limit(0);
print(fread($fp, 1024*8));
flush();
ob_flush();
}

fclose($fp);
}


Hindustan Times writing about Indian War Comics

After the Bangalore Mirror, it is now Hindustan Times publishing a news about JiniBooks and Indian War Comics available on iPad.

We all are now aware about ‘Indian War Comics’ and ‘BraveHearts of Mumbai – 26/11′ are available on iPad via JiniBooks. Its an honest and sincere effort by TechJini to make the content available digitaly, via iPad. Soon the other comics released by Indian War Comics will be available on iPad and other tablets as well. We are glad this effort is paying off and different media is also taking a note of our effort.

Congrats again to all the team!


Indian war heroes’ comics on iPad

Today Bangalore mirror published a small write up about TechJini’s efforts to salute the war heroes of Indian army.

Congrats to all TechJini team and especially Amit and Shyamal.

About ‘Bravehearts of Mumbai’

26/11/2008 is a sad day in Indian history, when the terrorists attacked the city of Mumbai. It was by brave effort of various Indian security forces like NSG, Mumbai Police the terror was brought to an end. Now Indian War Comics has immortalized story of one such hero, Maj Sandeep Unnikrishnan AC by launching their 3rd comic ‘Braveheart of Mumbai – 26/11’. The comic details Maj Sandeep Unnikrishnan’s valour while he was fighting Ajmal Kasab’s associates in Taj Hotel, during 60 hour Mumbai terror attacks in Nov 2008.

Indian War Comics has also partnered with TechJini Solutions, a Bangalore based IT company, to publish the stories on Smartphones and tablets using JiniBooks, an interactive content publishing platform. JiniBooks, enables small to medium size publishers and authors to reach bigger audience via digital medium. Authors can not only have static content but also build interactive magazines. Jinibooks is currently available only as an iPad application and soon it will be available for Android based tablets like Samsung tab etc.


Introduction to HTML 5 (part 1 of 10)

HTML 5

HTML is always considered as one of the important aspects of web development. Here, we are discussing about HTML5.

HTML5 which is currently under development is the next major revision of the HTML standard. Like its immediate Predecessors HTML4.01 and XHTML 1.1 , HTML5 is a standard for structuring and presenting content on world wide web.

This new standard incorporates features like video playback , drag and drop , geolocation, data storage , visiting websites offline , forms and many more.

Here is a brief history of HTML5.

HTML5 which is currently under development is the next major revision of the HTML standard.

There was never any such thing as HTML 1

The first official specification was HTML 2.0, published by the IETF, the Internet Engineering Task Force.

Later on the role of the IETF was superceded by the W3C, the World Wide Web Consortium, where subsequent iterations of the HTML standard have been published.

In the latter half of nineties HTML 4.01 was published.

After HTML 4.01, the next revision to the language was called XHTML 1.0

The content of the XHTML 1.0 specification was identical to that of HTML 4.01. No new elements or attributes were added.

The only difference was in the syntax of the language.

Valid XHTML 1.0 document requires all tags and attributes to be in lowercase. All attributes must be quoted.All elements must have a closing tag.

These rules were similar to that of XML.So they were moving towards XML more.

Then the W3C published XHTML 1.1.

It seemed as if the W3C were losing touch with the day-to-day reality of publishing on the web as they were moving towards XML.

They began working on XHTML 2

XHTML 2 wasn’t going to be backwards compatible with existing web content or even previous versions of HTML

Representatives from Opera, Apple and Mozilla were unhappy with this direction.

They formed their own group: the Web Hypertext Application Technology Working Group, or WHATWG

They started working on HTML Standard and came out with new revision HTML5

The W3C uses a consensus-based approach: issues are raised, discussed, and voted on.

At the WHATWG, issues are also raised and discussed, but the final decision on what
goes into a specification rests with the editor. The editor is Ian Hickson.

While HTML5 was being developed at the WHATWG, the W3C continued working on XHTML 2

Later on W3C admitted that the attempt to move the web from HTML to XML just wasn’t working.

Rather than start from scratch, they wisely decided that the work of the WHATWG should be used as the basis for any future version of HTML.

Later on W3C announced that they will stop working on XHTML 2 and they will support WHATWG.

There are two groups working on HTML5. The WHATWG is creating an HTML5 specification using its process of “commit then review.” The W3C HTML Working Group is taking that specification and putting it through its process of “review then
commit.”

TechJini Solutions
TechJini Solutions is Bangalore, India based company working in the areas of software product engineering services and creating next generation software products that bring real business value. We take pride in our philosophy of taking on challenging problems and providing innovative and outstanding solutions. We are proud to develop applications on different mobile/tablet platforms including iPhone, iPad, BlackBerry and Android.

Next time, we will look at Forms in HTML 5. Feel free to email me for more details – avidnyat@techjini.com


Steps For Publishing Application On Android Market

    Make your application non debuggable
  • Remove the android:debuggable="true" attribute from the <application> element of the manifest.
  • Remove log files, backup files, and other unnecessary files from the application project.
  • Check for private or proprietary data and remove it as necessary.
    Deactivate any calls to Log methods in the source code.
  • Is in your possession
  • Represents the personal, corporate, or organizational entity to be identified with the application
  • Has a validity period that exceeds the expected lifespan of the application or application suite. A validity period of more than 25 years is recommended.
  • If you plan to publish your application(s) on Android Market, note that a validity period ending after 22 October 2033 is a requirement. You can not upload an application if it is signed with a key whose validity expires before that date.
  • Is not the debug key generated by the Android SDK tools.
    Steps for creating the private key

  • Set the following paths for the environmental varialbles JAVA_HOME: C:\Program Files\Java\jdk1.6.0_20 PATH: C:\Program Files\Java\jdk1.6.0_20\bin

    (this value changes depending on where we have stored the jdk)

  • Right click on the project and do the following Androidtools>export signed application>next>select create new keystore>next>next>finish.
  • Open command prompt and type the following.Set the path to where the keystore is stored C:\Documents and Settings\bindu\Desktop>keytool -list -alias [aliasname] -keystore [keystorename]
  • We now have obtained the fingerprint
  • Now open the following link and enter the obtained finger print http://code.google.com/android/maps-api-signup.html
  • Now we have the private key in your google account.
    Register for a Maps API Key,if your application is using Map View element
    If your application uses one or more Mapview elements, you will need to register your application with the Google Maps service and obtain a Maps API Key, before your MapView(s) will be able to retrieve data from Google Maps. To do so, you supply an MD5 fingerprint of your signer certificate to the Maps service.

    Obfuscating the codeWe can use tools like ant and progaurd to obfuscate the code. Detailed steps for this is given in blog. http://android-developers.blogspot.com/

    Licensing the application After we finish all the above steps refer the following link to publish the application in the android market. http://developer.android.com/guide/publishing/licensing.html



  • TechJini Solutions

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