tag:blogger.com,1999:blog-11072034718305795352024-02-21T01:29:08.383-08:00Learning Mobile Applications DevelopmentSandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-1107203471830579535.post-56061699468718902412017-02-25T23:26:00.003-08:002017-02-25T23:28:25.897-08:00Quick connect to nearby connect<div dir="ltr" style="text-align: left;" trbidi="on">
This was the day when we were collecting food money anything which can be donated to the flood victims for Chennai. By evening we got everything in the evening we already had enough money and food supplies to be sent to Chennai.. We wanted a Truck ! It was difficult to find one .. We put it on our whatsapp group but we were mostly software engineers and none of us had a truck owner's or truck driver's phone number . Few we had which were either booked or out of station. At that time I thought of this app where we can just post and search our requirement with nearby people and get help from. Who knows at the same time hundreds of truck may be going just crossing us towards Chennai. Anyway after two hours of wait and search finally we got one Truck and we could send stuff to Chennai.<br />
<br />
Back home I started my research experimented on the available technologies, wrote few successful proof of concept app with redis, mongo and vertx-java. Then I came up with this idea of integrating nearby technology with a social network touch to make it very generic. It took me great deal of experiment to come up with a user friendly UX. Finally I am done and it's here as you see. It took me long and by the time lot of easier technology like firebase to build such servers have come up but i sticked to my design and technology as I feel it's more configurable.<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://play.google.com/store/apps/details?id=com.zoogaru.quikc&hl=en" target="_blank"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijdDRk545Rd013S5zMCUWulq3LHH5kVTRBW2EdemAEhFitThsxu-yG1iwgfdtvsvQ5Fi4T2eW4d2aQUMwGYvdK5dy4Xtyi8rQjY1eS7psPwmATWI-lz79bivbMEegJdoPpgkpgSCNT60Q/s400/quikc_home_framed.png" width="232" /></a><a href="https://play.google.com/store/apps/details?id=com.zoogaru.quikc&hl=en" style="margin-left: 1em; margin-right: 1em;" target="_blank"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSI9LsWfC-giBiZj9Htc4oMGVuRBNPrNqMgWufP6slB7cbyn2WuTx3JRfr68PEJ_lW9iTTwwBp9qIFeVPw1S9Lz0muNqOqaAch2cy1JMkcoOvP8deue1j4ZhQfkt8RenBatKV3kfXZhw/s400/quikc_health_framed.png" width="232" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Ok let me explain a little bit about this app and it's usage .</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
When we get any useful information of interest from someone unknown through any medium, We tend to ask WHO are you ? WHAT is this ? WHERE is this ? WHEN is this ? HOW much it cost ? etc etc . And if it's exciting and useful we try to help or visit or avail if it is NEARBY. Take few example say 1) A new Ice Cream shop which has opened just near your office and now that the owner wants to tell this to the nearby people, how would he tell all this in short and sweet manner ? 2) You went to a theater to watch a movie but unfortunately you had to leave it for some urgent work how would you sell ticket ? 3) You want to invite people nearby for free health camp . 4) Do carpool and let others know that you are giving free rides till your office. 5) You are going for a office party and you are in short of few people to avail a corporate discount. How will you find interested people from your office who may like to join and avail the offer ?</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Take this another case where and how <a href="https://play.google.com/store/apps/details?id=com.zoogaru.quikc&hl=en" target="_blank">Quikc</a> can help - NGO/College students want to drive the Nearby community for a weekend cleaning drive. They can create a post and publish it with Quikc with channel say #CleanSunday . Now the same message goes to every device who would be using this app and they can join and help. Also college students can use this app to invite unknown nearby interested students and do get-togethers for any such events.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
Another case let's say you need an electrician so you would ask nearby people usually to get his contact and then you call him, but what if he is farther he may not be available in-time.. Instead of wandering you can post the same message with #Quikc with a channel name say #NeedElectrician and someone nearby you may be an electrician or know fixing things who would be of your help.</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
<a href="https://play.google.com/store/apps/details?id=com.zoogaru.quikc&hl=en" target="_blank">Quikc</a> solves all these problems in a simple and user friendly way by an android app. Just post a message create a channel and push the message to nearby people and that's it you are done. Try this app from <a href="https://play.google.com/store/apps/details?id=com.zoogaru.quikc&hl=en" target="_blank">google play</a> share your feedback, suggestions and feel free to write me back if you want to say hello.</div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com1tag:blogger.com,1999:blog-1107203471830579535.post-34510173741517366652016-04-08T00:52:00.000-07:002016-04-08T00:52:19.171-07:00How to Facebook or Google or G+ login in android and fetch user profile <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
While working on an idea of my new app I had this requirement of allowing users to use there Facebook or Google account. Facebook auth was easy and without any difficulty I could get the users profile info etc. But Google Auth + GPlus data fetching was a pain as they both involve different api strategy and I started working on it but I was stuck for days ! Unfortunately any example I found in internet for Google Auth + GPlus data fetching is either obsolete or doesnt work ! Even googles developer page is also not updated with correct functions.</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<em style="box-sizing: border-box;">It was quite impossible to get both data in one api call !</em> I then cracked it with the below minor changes to my existing code. Hope it helps to any android enthusiatic.</div>
<div style="box-sizing: border-box; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; line-height: 25.6px; margin-bottom: 16px;">
<br /></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">It was quite impossible to get both data in one api call ! I then cracked it with the below minor changes to my existing code. Hope it helps to any android enthusiatic.</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">Fetch G+ data with GoogleSignin</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">A slight modification to GoogleSignInClient can fetchus both Google account + GPlus data</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">Create the GoogleSignInOptions as below</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .requestEmail()</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .requestScopes(new Scope(Scopes.PLUS_LOGIN))</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .build();</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">Create the GoogleApiClient as below</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">m_GoogleApiClient = new GoogleApiClient.Builder(m_activity)</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .enableAutoManage(m_activity, this)</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .addApi(Auth.GOOGLE_SIGN_IN_API, gso)</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .addApi(Plus.API)</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> .build();</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px;">public void fetchConnectedProfileInfo()</span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">{</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> Log.d(TAG, "fetchConnectedProfileInfo");</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> if (m_GoogleApiClient.hasConnectedApi(Plus.API)) {</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> Plus.PeopleApi.load(m_GoogleApiClient, "me").setResultCallback(this);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> }</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">}</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">Call fetchConnectedProfileInfo() from MainActivity.java onActivityResult()</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"><br /></span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">protected void onActivityResult(int requestCode, int resultCode, Intent data) {</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> super.onActivityResult(requestCode, resultCode, data);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> getCallbackManager().onActivityResult(requestCode, resultCode, data);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> if (requestCode == RC_SIGN_IN) {</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> Log.d(TAG, "handleSignInResult:" + result.isSuccess());</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> if (result.isSuccess()) {</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> GoogleSignInAccount acct = result.getSignInAccount();</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> Bundle googleData = m_gAuthProcessor.getGoogleAccData(acct);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> </span></span><span style="color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; line-height: 25.6px;">fetchConnectedProfileInfo();</span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> } else {</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> notifyus("googleAuthFailed", null);</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> // Signed out, show unauthentic</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> }</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;"> }</span></span></div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<span style="color: #333333; font-family: Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;"><span style="line-height: 25.6px;">}</span></span></div>
Code is available here <a href="https://github.com/sandipsahoo2k2/social-login">https://github.com/sandipsahoo2k2/social-login</a></div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-57756385842753470192016-03-27T05:04:00.001-07:002016-03-27T07:13:09.803-07:00creating a mobile site with users status | realtime apps<div dir="ltr" style="text-align: left;" trbidi="on">
we would be using digital ocean for this<br />
<br />
https://www.digitalocean.com/community/articles/initial-server-setup-with-ubuntu-12-04<br />
https://www.digitalocean.com/community/articles/how-to-set-up-a-host-name-with-digitalocean<br />
https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu<br />
<br />
https://www.digitalocean.com/community/articles/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps<br />
<br />
install npm and nodejs in digital ocean<br />
create a soft link for nodejs<br />
<br />
ln -s /usr/bin/nodejs /usr/bin/node other wise you wont be able to install redis/hiredis with node module.<br />
<span class="pun" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-I</span><span class="pun" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">/</span><span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">usr</span><span class="pun" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">/</span><span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">include</span><span class="pun" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">/</span><span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">x86_64</span><span class="pun" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-</span><span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">linux</span><span class="pun" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">-</span><span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">gnu if make fails for redis compilation</span><br />
<span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><br /></span>
<span class="pln" style="border: 0px; font-family: "consolas" , "menlo" , "monaco" , "lucida console" , "liberation mono" , "dejavu sans mono" , "bitstream vera sans mono" , "courier new" , monospace , serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><a href="http://garydengblog.wordpress.com/2013/06/28/simple-chat-application-using-redis-socket-io-and-node-js/comment-page-1/" target="_blank">Great Tutorial</a></span><br />
http://www.smartjava.org/content/create-simpe-restful-service-vertx-20-rxjava-and-mongodb<br />
http://www.javaworld.com/article/2078838/mobile-java/open-source-java-projects-vert-x.html?null<br />
<br />
<br />
android examples<br />
-----------------<br />
http://javapapers.com/android/android-chat-with-google-gcm-xmpp/<br />
http://www.androidhive.info/2016/02/android-push-notifications-using-gcm-php-mysql-realtime-chat-app-part-3/<br />
http://code.tutsplus.com/tutorials/quick-tip-add-facebook-login-to-your-android-app--cms-23837<br />
<br />
<br /></div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-62326378237941988662014-11-15T09:18:00.003-08:002014-11-15T10:15:10.380-08:00Why I couldn't do what an UXD proposed me to do in my android app<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<i>Don’t shoot a programmer, He
draws as he can..</i></div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<b>Things to keep in mind with
UI Assets.. </b><o:p></o:p></div>
<div class="MsoNormal">
<b><br /></b></div>
<div class="MsoNormal">
Scale and Size of Image and
Icons. For every icon/image that we
would use strictly follow android UI guidelines so we need 5 size for icons
with <b>2:3:4:6:8 scaling ratio</b>.<span class="apple-converted-space"><span style="background: #F9F9F9; color: #222222; font-family: "Arial","sans-serif"; font-size: 10.5pt; line-height: 115%;"> </span></span>This means the baseline (MDPI) asset is 48x48 px, and the
high-density(HDPI) asset should be 1.5x the baseline at 72x72 px, and the
x-high density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal" style="text-indent: .5in;">
Refer:
<a href="http://developer.android.com/design/style/iconography.html">http://developer.android.com/design/style/iconography.html</a><o:p></o:p></div>
<br />
<div class="MsoNormal">
So we must create icons/image
with above scalling. The easiest thing for a
developer to use <a href="http://romannurik.github.io/AndroidAssetStudio/">http://romannurik.github.io/AndroidAssetStudio/</a> link.</div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpqoNs2ui0I4sjciQO_hNyl9AntXomczyuhuoXn1u23N-gDRrs253cmlk0lgD0ikNWoKbCPiojrtFB1gp9XaedWyNnSt8DEgDe8E7bSk4WHcSU9UzmI5ULWVaxNSV0t1wkmDQSUGr9Q8o/s1600/temp.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpqoNs2ui0I4sjciQO_hNyl9AntXomczyuhuoXn1u23N-gDRrs253cmlk0lgD0ikNWoKbCPiojrtFB1gp9XaedWyNnSt8DEgDe8E7bSk4WHcSU9UzmI5ULWVaxNSV0t1wkmDQSUGr9Q8o/s1600/temp.png" height="125" width="320" /></a><b>Howto’s</b> : If
we have the <b><i>highest density and scaled </i></b>image we can easily create assets
with the above link for Luncher/Action bar/Notification/Generic Icons. This
tool will create all necessary set of icons for all device size. Note : Create
an image/icon with highest density/scale
with GIMP or adobe illustartor first then use them as the input for the above
tools.<o:p></o:p></div>
<div class="MsoNormal">
<b>Some Take away :<o:p></o:p></b></div>
<div class="MsoNormal">
<b><br /></b></div>
<div class="MsoNormal">
<i>Splash Screen </i> – I couldn’t implement it cause the
screen-shot that the UXD gave me was not covering the phone width, it was little
ugly when I tried to stretch and I didn’t have screen shot for the Icons that I
had created with a replacement for the icons shared by him, for the helper
views too. So skipped for this release (I liked the proposal, if not today some
day I will incorporate with the app)<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<i>SearchWidget</i>
– I am using the default android search widget in which the search_icon comes
in the left side I tried a lot, did some search but could not make it possible
to keep it in right side. (I could have achieved with my customized search
widget which would take me few days to build !, Why ? if I make my customized
control again that should follow android UI specifications which would need me
to create controls for every device size, everycolor, 9 patch image, icons-
which would be cost me around a week of time, its lack of time that forced me
to keep it still hidden and pops up from a menu click). <o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<i>Location Icons</i> – Customized location Icons again has to be for different device density.
And the location icon given to me was eye catchy though I had to use the
default map icons. Icons were left anchored but my requirement was for centered
gravity.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<i>Theme with the app color</i> : It took me a few days to find out the best theme
color that suit my app. I did a lot of experiement with themes. There are still
some controls, for which its hard to create theme specific controls e.g android
switch ! So I am still living with the
default android theme controls.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-indent: .5in;">
Refer:
<a href="http://android-holo-colors.com/">http://android-holo-colors.com/</a><o:p></o:p></div>
<div class="MsoNormal" style="text-indent: .5in;">
Refer
: <span style="background: white; color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"><a href="http://www.google.com/design/spec/style/color.html%23color-ui-color-application">http://www.google.com/design/spec/style/color.html#color-ui-color-application</a><o:p></o:p></span></div>
<div class="MsoNormal" style="text-indent: .5in;">
<span style="background: white; color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;">Refer : The links that I refer while creating my icons for my app /
webpages.</span></div>
<div class="MsoNormal" style="text-indent: .5in;">
<span style="background: white; color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"> <a href="http://quickmobi.blogspot.com/2014/09/websites-building-references.html">http://quickmobi.blogspot.com/2014/09/websites-building-references.html</a><o:p></o:p></span></div>
<div class="MsoNormal" style="text-indent: .5in;">
<br /></div>
<div class="MsoNormal">
<i><span style="background: white; color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;">Geo-Pulse list icons</span></i><span style="background: white; color: #333333; font-family: "Arial","sans-serif"; font-size: 11.5pt; line-height: 115%;"> – Again the asset that he shared was awesome
but I couldn’t generate icons using <a href="http://romannurik.github.io/AndroidAssetStudio/icons-generic.html">http://romannurik.github.io/AndroidAssetStudio/icons-generic.html</a></span> link. We must generate all icons with the android
studio as it ensures that we have the right size and scaled icons. But remember
any given icon by a designer should be with the highest size i.e 192px/192px (if not minm should be atlest
96px / 96px) so that you can create smaller and bigger icons wihtout loosing
the quality. The most important thing is any icon given by a designer should be
transparent in nature without which you cant create icon for different devices
using the above links. So I had to create my own icons with cliparts that
collected from web which are holo and tranparent and matched the UXD’s
proposals.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<i>Luncher Icon :</i>Luncher icon should be created from a 512px / 512px Image without which
you will loose the quality again for
different devices. Just a small note, all the assets name should be in small
letters and underscores (no hiphens) . <o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal" style="text-indent: .5in;">
Refer
: <a href="http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html">http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html</a></div>
<div class="MsoNormal" style="text-indent: .5in;">
<span style="font-family: Times, 'Times New Roman', serif; text-indent: 0px;"><br /></span></div>
<div class="MsoNormal" style="text-indent: .5in;">
<i><span style="font-family: Times, 'Times New Roman', serif; text-indent: 0px;">This is just for book keeping of all that I did for </span><a href="https://play.google.com/store/apps/details?id=com.zoogaru.android.zpulse" style="font-family: Times, 'Times New Roman', serif; text-indent: 0px;" target="_blank">ZPulse</a><span style="font-family: Times, 'Times New Roman', serif; text-indent: 0px;"> which might help for an enthusiastic android programmer and ease him for beautification for his/her app.</span></i></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-12979097521402787702014-10-04T17:49:00.003-07:002014-10-06T09:28:04.515-07:00How to set events on EditTextPreference dialog like longpress <div dir="ltr" style="text-align: left;" trbidi="on">
Spent a lot on working on the preferences settings in android google also couldn't help me at last I could do some experiement and made it work.<br />
<div>
<br /></div>
<div>
Goal : Open the Contacts and fill the phone number in one of the inputs for Preferences.</div>
<div>
<br /></div>
<div>
e.g You want to set the Number only Edit text</div>
<div>
<br /></div>
<div>
<div>
public class SettingsFragment extends PreferenceFragment {</div>
<div>
@Override</div>
<div>
public void onCreate(Bundle savedInstanceState) {</div>
<div>
super.onCreate(savedInstanceState);</div>
<div>
addPreferencesFromResource(R.xml.preferences_activity);</div>
<div>
</div>
<div>
Preference<span class="Apple-tab-span" style="white-space: pre;"> </span>preference = findPreference("EMERGENCY_PH_NO") ;</div>
<div>
EditTextPreference editTextPreference = (EditTextPreference) preference;</div>
<div>
}</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
now its easy just grab the handle and set the longpress event</div>
<div>
<br /></div>
<div>
All the code is given below</div>
<div>
<br /></div>
<div>
<div>
public class SettingsFragment extends PreferenceFragment {</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>EditText m_emergency_number = null;</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>final int EMERGENCY_CONTACT_PICK = 1337;</div>
<div>
<span style="white-space: pre;"> </span></div>
<div>
@Override</div>
<div>
public void onCreate(Bundle savedInstanceState) {</div>
<div>
super.onCreate(savedInstanceState);</div>
<div>
addPreferencesFromResource(R.xml.preferences_activity);</div>
<div>
</div>
<div>
Preference<span class="Apple-tab-span" style="white-space: pre;"> </span>preference = findPreference("EMERGENCY_PH_NO") ;</div>
<div>
EditTextPreference editTextPreference = (EditTextPreference) preference;</div>
<div>
//TextView TextView = (TextView) editTextPreference.getEditText();</div>
<div>
m_emergency_number = (EditText) editTextPreference.getEditText(); </div>
<div>
m_emergency_number.setOnLongClickListener(new OnLongClickListener() {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Override</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>public boolean onLongClick(View v) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated method stub</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>openContact(EMERGENCY_CONTACT_PICK);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return true;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>});</div>
<div>
} </div>
<div>
</div>
<div>
void openContact(int who)</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>Intent intent = new Intent(Intent.ACTION_PICK,ContactsContract.Contacts.CONTENT_URI);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>intent.setType(Phone.CONTENT_TYPE); // Show user only contacts w/ phone numbers</div>
<div>
startActivityForResult(intent, who);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
</div>
<div>
@Override</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>public void onActivityResult(int requestCode, int resultCode, Intent aData) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// TODO Auto-generated method stub</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>if (resultCode == Activity.RESULT_OK) </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> Uri contactUri = aData.getData();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> //Intent intent = new Intent(Intent.ACTION_GET_CONTENT,contactData);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> //startActivityForResult(intent, 1336);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> String[] projection = {Phone.NUMBER};</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> Cursor cursor = getActivity().getContentResolver().query(contactUri, projection, null, null, null);</div>
<div>
cursor.moveToFirst();</div>
<div>
<br /></div>
<div>
// Retrieve the phone number from the NUMBER column</div>
<div>
int column = cursor.getColumnIndex(Phone.NUMBER);</div>
<div>
String number = cursor.getString(column);<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
if(EMERGENCY_CONTACT_PICK == requestCode)</div>
<div>
{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>m_emergency_number.setText(number);</div>
<div>
}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
}</div>
</div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-49184592772702916342014-09-24T14:48:00.000-07:002014-10-06T09:28:32.580-07:00android layout tricks<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Merging a image with map</b><br />
<br />
<?xml version="1.0" encoding="utf-8"?><br />
<merge xmlns:android="http://schemas.android.com/apk/res/android"<br />
android:orientation="vertical"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"><br />
<fragment<br />
android:id="@+id/map"<br />
android:layout_width="match_parent"<br />
android:layout_height="match_parent"<br />
android:name="com.google.android.gms.maps.MapFragment"/><br />
<br />
<RelativeLayout<br />
android:id="@+id/rl"<br />
android:layout_width="fill_parent"<br />
android:layout_height="fill_parent"<br />
><br />
<br />
<ImageButton<br />
android:id="@+id/icon"<br />
android:layout_width="wrap_content"<br />
android:layout_height="wrap_content"<br />
android:layout_alignParentRight="true"<br />
android:layout_alignParentTop="true"<br />
android:layout_marginTop="20dp"<br />
android:<br />
android:src="@drawable/star" /><br />
<br />
</RelativeLayout><br />
</merge><br />
<br />
Actionbar theming<br />
-------------------------<br />
http://jgilfelt.github.io/android-actionbarstylegenerator/#name=example&compat=sherlock&theme=light&actionbarstyle=transparent&texture=0&hairline=0&neutralPressed=1&backColor=E4E4E4%2C100&secondaryColor=D6D6D6%2C100&tabColor=9c0%2C100&tertiaryColor=690%2C100&accentColor=6ad869%2C100&cabBackColor=FFFFFF%2C100&cabHighlightColor=33B5E5%2C100</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-47031626550545227902014-09-21T11:48:00.000-07:002015-01-10T14:54:55.992-08:00All about signing the apk and its effect in google play<div dir="ltr" style="text-align: left;" trbidi="on">
<ol style="background-color: #f9f9f9; margin: 0px 0px 15px 18px; padding: 0px;">
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 0px 0px 5px;"><div style="margin-bottom: 5px; margin-top: 5px;">
Generate a private key using <code style="color: #006600; font-size: 13px; line-height: 14px;"><a href="http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html" style="color: #258aaf; text-decoration: none;">keytool</a></code>. For example:</div>
<pre class="prettyprint" style="background: rgb(247, 247, 247); border: 1px solid rgb(221, 221, 221); color: #006600; font-size: 13px; line-height: 1.5; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 1em;"><span class="pln" style="color: black;">$ keytool </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">genkey </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">v </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keystore </span><span class="kwd" style="color: #000088;">my</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">release</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">key</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">keystore</span><span class="pun" style="color: #666600;">-</span><span class="kwd" style="color: #000088;">alias</span><span class="pln" style="color: black;"> alias_name </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keyalg RSA </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keysize </span><span class="lit" style="color: #006666;">2048</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">validity </span><span class="lit" style="color: #006666;">10000</span></pre>
<div style="margin-bottom: 5px; margin-top: 5px;">
This example prompts you for passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called <code style="color: #006600; font-size: 13px; line-height: 14px;">my-release-key.keystore</code>. The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app.</div>
</li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;"><div style="margin-bottom: 5px; margin-top: 5px;">
Compile your app in release mode to obtain an unsigned APK.</div>
</li>
<li style="margin: 18px 0px 5px;"><span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">Stand on google_play_services first then run below commands</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">android update lib-project --path .</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">ant clean</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">ant release</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">stand on your project root folder</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">android update lib-project --path .</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">ant clean</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">ant release</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;"><br /></span></span>
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">make sure your project file is updated with</span></span><br />
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 19px;">android.library.reference.2=../../Android/sdk/extras/google/google_play_services/libproject/google-play-services_lib</span></span></li>
<li style="margin: 18px 0px 5px;"><span style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px;">Sign your app with your private key using </span><code style="color: #006600; font-size: 13px; line-height: 14px;"><a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html" style="color: #258aaf; text-decoration: none;">jarsigner</a></code><span style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px;">:</span></li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;">
<pre class="prettyprint" style="background: rgb(247, 247, 247); border: 1px solid rgb(221, 221, 221); color: #006600; font-size: 13px; line-height: 1.5; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 1em;"><span class="pln" style="color: black;">$ jarsigner </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">verbose </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">sigalg SHA1withRSA </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">digestalg SHA1</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keystore </span><span class="kwd" style="color: #000088;">my</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">release</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">key</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">keystore my_application</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">apk alias_name</span></pre>
<div style="margin-bottom: 5px; margin-top: 5px;">
This example prompts you for passwords for the keystore and key. It then modifies the APK in-place to sign it. Note that you can sign an APK multiple times with different keys.</div>
</li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;"><div style="margin-bottom: 5px; margin-top: 5px;">
Verify that your APK is signed. For example:</div>
<pre class="prettyprint" style="background: rgb(247, 247, 247); border: 1px solid rgb(221, 221, 221); color: #006600; font-size: 13px; line-height: 1.5; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 1em;"><span class="pln" style="color: black;">$ jarsigner </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">verify </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">verbose </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">certs my_application</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">apk</span></pre>
</li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;"><div style="margin-bottom: 5px; margin-top: 5px;">
Align the final APK package using <code style="color: #006600; font-size: 13px; line-height: 14px;"><a href="http://developer.android.com/tools/help/zipalign.html" style="color: #258aaf; text-decoration: none;">zipalign</a></code>.</div>
<pre class="prettyprint" style="background: rgb(247, 247, 247); border: 1px solid rgb(221, 221, 221); color: #006600; font-size: 13px; line-height: 1.5; margin-bottom: 5px; margin-top: 5px; overflow: auto; padding: 1em;"><span class="pln" style="color: black;">$ zipalign </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">v </span><span class="lit" style="color: #006666;">4</span><span class="pln" style="color: black;"> your_project_name</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">unaligned</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">apk your_project_name</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">apk</span></pre>
<div style="margin-bottom: 5px; margin-top: 5px;">
<code style="color: #006600; font-size: 13px; line-height: 14px;">zipalign</code> ensures that all uncompressed data starts with a particular byte alignment relative to the start of the file, which reduces the amount of RAM consumed by an app</div>
</li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;"><div style="margin-bottom: 5px; margin-top: 5px;">
How to check your details in the keystore </div>
</li>
<li style="color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 19px; margin: 18px 0px 5px;"><pre class="lang-java prettyprint prettyprinted" style="background: rgb(238, 238, 238); border: 0px; color: black; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; line-height: 17.804801940918px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keytool </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">list </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keystore </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keystore</span></code></pre>
</li>
<li style="margin: 18px 0px 5px;"><pre class="lang-java prettyprint prettyprinted" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><pre class="lang-java prettyprint prettyprinted" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: black; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; line-height: 17.804801940918px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;"><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keytool </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">list </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keystore </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">keystore </span><span class="pun" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline;">alias foo</span></code></pre>
<ol style="background-color: #f9f9f9; font-family: 'Times New Roman'; margin: 0px 0px 15px 18px; padding: 0px; white-space: normal;">
<li style="margin: 18px 0px 5px;"><pre class="lang-java prettyprint prettyprinted" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; line-height: 17.804801940918px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"><code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 13.3333339691162px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;">List all info ::</code></pre>
</li>
</ol>
<span style="background-color: white; color: black; font-family: 'Courier New', Courier, monospace; font-size: 13.3333339691162px; line-height: 19.5px; white-space: normal;">keytool -list -v -keystore </span><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 19.5px; white-space: normal;">android-release-key.keystore</span></span></pre>
</li>
</ol>
<div>
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small;"><span style="line-height: 17.804801940918px; white-space: pre;">How to find that debug SHA1 ley to be used by Android MAP key</span></span></div>
<div>
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small;"><span style="line-height: 17.804801940918px; white-space: pre;"><br /></span></span></div>
<div>
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small;"><span style="line-height: 17.804801940918px; white-space: pre;">keytool -list -v -keystore C:\Users\<username>\.android\debug.keystore</span></span></div>
<div>
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small;"><span style="line-height: 17.804801940918px; white-space: pre;">password : android</span></span><br />
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small;"><span style="line-height: 17.804801940918px; white-space: pre;"><br /></span></span>
<span style="font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif; font-size: x-small; line-height: 17.804801940918px; white-space: pre;">keytool -exportcert -alias androiddebugkey -keystore C:\Users\ssaho3\.android\debug.keystore -list -v</span></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com1tag:blogger.com,1999:blog-1107203471830579535.post-34753868870185979222014-09-19T17:29:00.002-07:002015-08-09T19:05:23.151-07:00websites building references<div dir="ltr" style="text-align: left;" trbidi="on">
http://www.layoutit.com/<br />
https://bootstrapbay.com/blog/bootstrap-editors/<br />
https://css-tricks.com/perfect-full-page-background-image/<br />
http://nicolasgallagher.com/css-background-image-hacks/<br />
http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height<br />
Ready made themes<br />
---------------------------<br />
http://premium.wpmudev.org/blog/30-top-quality-free-minimalist-and-stunning-wordpress-themes/<br />
http://www.wpexplorer.com/pytheas-free-wordpress-theme/<br />
https://wordpress.org/themes/tags/one-column<br />
http://theme.wordpress.com/themes/features/one-column/<br />
http://www.wpexplorer.com/pytheas-free-wordpress-theme/<br />
http://speckyboy.com/2014/05/27/free-bootstrap-3-templates/<br />
http://speckyboy.com/2014/12/08/jquery-plugins-2014/<br />
http://plugins.adchsm.me/slidebars/index.php#download<br />
<br />
Plugins<br />
------------<br />
http://tutorialzine.com/2013/04/50-amazing-jquery-plugins/<br />
https://css-tricks.com/text-blocks-over-image/<br />
http://nick-jonas.github.io/windows/<br />
http://joelb.me/scrollpath/<br />
http://www.seanmccambridge.com/tubular/<br />
http://buildinternet.com/project/supersized/download.html<br />
http://vegas.jaysalvat.com/<br />
http://tutorialzine.com/2012/06/quick-tip-fullscreen-backgrounds/<br />
<br />
Web Color theme and pallet choosers<br />
------------------------------<br />
http://www.colorzilla.com/<br />
kuler.adobe.com<br />
http://paletton.com<br />
http://www.google.com/design/spec/style/color.html#color-ui-color-application<br />
http://pixabay.com/en/<br />
http://apps.pixlr.com/editor/<br />
<br />
Logo : 250/100 px<br />
http://ocpsoft.org/tutorials/regular-expressions/java-visual-regex-tester/<br />
http://ocpsoft.org/opensource/guide-to-regular-expressions-in-java-part-1/<br />
http://www.mobyaffiliates.com/blog/how-to-promote-your-ios-and-android-mobile-apps/<br />
<br />
For android<br />
-------------<br />
http://romannurik.github.io/AndroidAssetStudio/index.html<br />
http://jgilfelt.github.io/android-actionbarstylegenerator/<br />
http://android-holo-colors.com/<br />
https://developer.android.com/distribute/tools/promote/device-art.html<br />
http://www.norio.be/android-feature-graphic-generator/<br />
http://www.cs.dartmouth.edu/~campbell/cs65/lecture24/lecture24.html<br />
<br />
Theming a searchview's autocomplete is tricky as it looks black !! from Theme.Holo.Light.DarkActionBar<br />
This is what you need to do<br />
<br />
<!-- this style is only referenced in a Light.DarkActionBar based theme --><br />
<style name="Theme.Zpulse.Widget" parent="@android:style/Theme.Holo"><br />
<item name="android:popupMenuStyle">@style/PopupMenu.Zpulse</item><br />
<item name="android:dropDownListViewStyle">@style/DropDownListView.Zpulse</item><br />
<item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewAppTheme</item><br />
</style><br />
<br />
<style name="AutoCompleteTextViewAppTheme" parent="android:Widget.Holo.Light.AutoCompleteTextView"><br />
<item name="android:dropDownSelector">@drawable/apptheme_list_selector_holo_light</item><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <item name="android:background">@drawable/apptheme_edit_text_holo_light</item><br />
</style><br />
<br />
Promote:<br />
<span style="background-color: white; color: #474747; font-family: 'Open Sans', Helvetica, sans-serif; font-size: 16px; line-height: 24px;">On launch date, you can also consider submitting your press release to sites like </span><a href="http://www.prweb.com/" style="-webkit-transition: border 0.2s, color; background: rgb(255, 255, 255); border-bottom-color: rgb(247, 148, 34); border-bottom-style: solid; border-bottom-width: 1px; box-sizing: border-box; color: #f79422; font-family: 'Open Sans', Helvetica, sans-serif; font-size: 16px; line-height: 24px; text-decoration: none; transition: border 0.2s, color;" title="PRWeb">PRWeb</a><span style="background-color: white; color: #474747; font-family: 'Open Sans', Helvetica, sans-serif; font-size: 16px; line-height: 24px;"> </span><span style="background-color: white; color: #474747; font-family: 'Open Sans', Helvetica, sans-serif; font-size: 16px; line-height: 24px;"> There’s no shortage of Press Release submission websites but definitely go for quality, not quantity.</span><br />
<span style="background-color: white; color: #474747; font-family: Open Sans, Helvetica, sans-serif; line-height: 24px;">http://www.rahuljiresal.com/2014/02/user-location-on-android/</span><br />
<br />
LogoDesign<br />
--------------<br />
http://www.logogarden.com/</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-36874662271750123642014-09-06T11:21:00.004-07:002014-11-02T10:32:07.372-08:00Integrating php-mailgun for auth user<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: #eeeeee; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><span style="color: #222222; font-family: Ubuntu Mono, Ubuntu Beta Mono A, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;">Follow : https://github.com/mailgun/mailgun-php</span></span><br />
<span style="background-color: #eeeeee; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><span style="color: #222222; font-family: Ubuntu Mono, Ubuntu Beta Mono A, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><br /></span></span>
<br />
<div style="text-align: left;">
<span style="background-color: #eeeeee; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><span style="color: #222222; font-family: Ubuntu Mono, Ubuntu Beta Mono A, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;">Install curl php as below</span></span></div>
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;">sudo apt-get install curl libcurl3 libcurl3-dev php5-curl</span><br />
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;">restrat the apache server.</span><br />
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;">sudo service apache2 restart</span><br />
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><br /></span>
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><br /></span>
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><br /></span>
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;">Github Most frequent command</span><br />
<span style="background-color: #eeeeee; color: #222222; font-family: 'Ubuntu Mono', 'Ubuntu Beta Mono A', Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;"><br /></span>
<span style="background-color: #eeeeee; color: #222222; font-family: Ubuntu Mono, Ubuntu Beta Mono A, Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace; font-size: 14px; line-height: 18.2000007629395px; white-space: pre-wrap;">git push origin master</span><br />
<span style="background-color: white; color: #f14e32; font-family: Courier, monospace; font-size: 14px; line-height: 18px; white-space: pre;">git tag -a v1.4 -m 'my version 1.4'</span><br />
<pre style="background-color: #f0f0f0; color: #333333; font-family: ConfluenceInstalledFont, monospace; font-size: 14px; line-height: 1.3; padding: 0px;">git push origin --tags</pre>
<pre style="background-color: #f0f0f0; color: #333333; font-family: ConfluenceInstalledFont, monospace; font-size: 14px; line-height: 1.3; padding: 0px;">
</pre>
<pre style="background-color: #f0f0f0; color: #333333; font-family: ConfluenceInstalledFont, monospace; font-size: 14px; line-height: 1.3; padding: 0px;">Go back to last version</pre>
<pre style="background-color: #f0f0f0; padding: 0px;"><span style="color: #333333; font-family: ConfluenceInstalledFont, monospace;"><span style="font-size: 14px; line-height: 18.2000007629395px;">git reset --hard HEAD</span></span></pre>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-61529436194689610032014-07-03T17:35:00.001-07:002014-09-06T11:22:34.694-07:00Compatibility chart for java script libaries<div dir="ltr" style="text-align: left;" trbidi="on">
BackBone<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><br />
<script src="http://ajax.cdnjs.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script><br />
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.2/backbone-min.js"></script><br />
<div>
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-15593865124574452152014-06-15T14:22:00.002-07:002014-06-15T14:22:27.724-07:00How to read phonebook with phonegap from android<div dir="ltr" style="text-align: left;" trbidi="on">
function queryPhoneBook()<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>// find all contacts field<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var options = new ContactFindOptions();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>options.filter="";<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>options.multiple=true;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var fields = ["name", "phoneNumbers"];<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>navigator.contacts.find(fields, onSuccess, onError, options);<br />
}<br />
<br />
function onSuccess(contacts) {<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//navigator.notification.alert(contacts.length);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var j = 0;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$.mobile.showPageLoadingMsg(true);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//$("#userList").html('');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>for(var i=0; i < contacts.length ; i++)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if( contacts[i].phoneNumbers == null )<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>continue;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(contacts[i].phoneNumbers.length > 0)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>{<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//navigator.notification.alert(contacts[i]);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>//var temp = contacts[i].displayName + "" + contacts[i].phoneNumbers[0].value;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>//navigator.notification.alert(temp);<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var htmlData = '<li id="'+j+'"><a href="#"><h2>'+contacts[i].displayName+'</h2><p class="ui-li-aside">'+contacts[i].phoneNumbers[0].value+'</p></a></li>';<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$("#userList").append(htmlData).listview('refresh');<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>j++;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span>$.mobile.changePage($("#index"), { transition : "slide"});<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$.mobile.hidePageLoadingMsg();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<div>
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-27136592222145974942014-06-05T06:35:00.001-07:002015-06-27T21:55:51.087-07:00Playing with digital Ocean<div dir="ltr" style="text-align: left;" trbidi="on">
amazon ec2 seemed to be complecated though not so difficlut but I am trying didgital ocean now for all my home based research here is what i did today to setup a new instance of droplet and installed Lamp<br />
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
passwd</div>
<div>
adduser sandeep</div>
<div>
<br /></div>
<div>
visudo</div>
<div>
<br /></div>
<div>
# User privilege specification</div>
<div>
root ALL=(ALL:ALL) ALL</div>
<div>
demo ALL=(ALL:ALL) ALL</div>
<div>
<br /></div>
<div>
nano /etc/ssh/sshd_config</div>
<div>
Port 4444</div>
<div>
<br /></div>
<div>
PermitRootLogin no</div>
<div>
AllowUsers sandeep</div>
<div>
<br /></div>
<div>
sudo apt-get update</div>
<div>
sudo apt-get install apache2</div>
<div>
<br /></div>
<div>
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql</div>
<div>
sudo mysql_install_db</div>
<div>
sudo /usr/bin/mysql_secure_installation</div>
<div>
<br /></div>
<div>
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt</div>
<div>
<br /></div>
<div>
sudo nano /etc/apache2/mods-enabled/dir.conf </div>
<div>
change index.php<br />
<br />
https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-wordpress-sites-using-multisite<br />
<br />
<b>Get the Mysql password</b><br />
<br />
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: monospace, serif; font-size: 14px; margin-bottom: 24px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; color: #111111; font-family: monospace, serif; margin: 0px; padding: 0px;">tail -1 /root/.my.cnf | awk -F'=' '{print $2}'</code></pre>
<b>Setting Up Java</b><br />
<br />
sudo apt-get install default-jre<br />
sudo apt-get install default-jdk<br />
sudo nano /etc/environment and append this line<br />
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64<br />
source /etc/environment<br />
echo $JAVA_HOME<br />
<br />
Installing SFTP/ProFtp<br />
<br />
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: monospace, serif; font-size: 14px; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; color: #111111; font-family: monospace, serif; margin: 0px; padding: 0px;">sudo apt-get update && sudo apt-get install proftpd</code></pre>
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; font-family: monospace, serif; font-size: 14px; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; color: #111111; font-family: monospace, serif; margin: 0px; padding: 0px;"><span style="background-color: white; color: #333333; font-family: 'Courier New', Courier, Fixed; font-size: 13px; white-space: normal;">apt-get install openbsd-inetd</span></code></pre>
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin: 0px; padding: 0px;"><span style="background-color: white; color: #333333; font-family: Courier New, Courier, Fixed; white-space: normal;">lrwxrwxrwx 1 root root 16 Sep 23 15:34 openlibs -> /opt/GLOBAL/libs
lrwxrwxrwx 1 root root 20 Sep 23 15:34 openservices -> /opt/GLOBAL/services
00 12 * * sat /home/root/monitoring/config/start/procmon.sh
00 12 * * sat /home/root/monitoring/config/stop/procmon.sh
CLASSPATH="/usr/java/bin:/home/s_gcm/gcmserver:/home/s_gcm/gcmserver/libs"</span></code></pre>
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">https://www.digitalocean.com/community/tutorials/how-to-configure-proftpd-to-use-sftp-instead-of-ftp
Setting up Smack library in Ubuntu
wget http://www.java2s.com/Code/JarDownload/xmlpull/xmlpull-xpp3-1.1.4c.jar.zip
http://www.java2s.com/Code/JarDownload/xmlpull/xmlpull-xpp3-1.1.4c.jar.zip</span></code></pre>
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;"><b>Setting up two domain names with DO</b></span></code></pre>
<pre style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; word-wrap: normal !important;"><code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps</span></code></pre>
<h2 style="background-color: #f6f6f6; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; box-sizing: border-box; margin-bottom: 28px; overflow: auto !important; padding: 13px 17px; text-align: left; word-wrap: normal !important;">
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">Setting up a subdomain e.g <blog> in this case</span></code></h2>
</div>
</div>
<div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;"></span></code><br />
<div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">Lets say subdomain name is blog on zoogaru.com</span></code></div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">
</span></code>
<br />
<div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;"><br /></span></code></div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">
</span></code>
<br />
<div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">sudo mkdir -p /var/www/blog.zoogaru.com/public_html</span></code></div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">
</span></code>
<div>
<code style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; font-size: 14px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">sudo chown -R www-data:www-data /var/www/blog.zoogaru.com/public_html</span></code></div>
<code style="border-radius: 0px; margin: 0px; padding: 0px;"><span style="color: #111111; font-family: monospace, serif;">
<div style="font-size: 14px;">
sudo chmod -R 755 /var/www</div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
put all content with an index file at </div>
<div style="font-size: 14px;">
/var/www/blog.zoogaru.com/public_html/</div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/blog.zoogaru.com.conf</div>
<div style="font-size: 14px;">
vi /etc/apache2/sites-available/blog.zoogaru.com.conf</div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
update ServerAdmin blog@zoogaru.com</div>
<div style="font-size: 14px;">
add ServerName blog.zoogaru.com</div>
<div style="font-size: 14px;">
update DocumentRoot /var/www/blog.zoogaru.com/public_html</div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
last and final step:</div>
<div style="font-size: 14px;">
sudo a2ensite blog.zoogaru.com</div>
<div style="font-size: 14px;">
sudo service restart apache2<br />
or<br />
<span style="background-color: #eeeeee; font-family: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; font-size: 12px; line-height: 17.9969997406006px;">/etc/init.d/apache2 restart</span></div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
create a CNAME record in your owned domain as</div>
<div style="font-size: 14px;">
* => @ </div>
<div>
<div style="font-size: 14px;">
give 20-30 minutes to zone file to be propagated.</div>
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
Using filters on JSON</div>
<span style="font-size: 14px;">$scope.selectedTransporter = $filter('filter')($rootScope.CACHE['TRANSPORTER'], $scope.record.transporter_id);</span><br />
<div style="font-size: 14px;">
<br /></div>
<div style="font-size: 14px;">
<b>phpmyadmin upgrade =></b></div>
<div style="font-size: 14px;">
<br /></div>
<pre style="background-color: #eeeeee; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: 13px; margin-bottom: 1em; max-height: 600px; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">sudo add-apt-repository ppa:nijel/phpmyadmin;
sudo apt-get update;
sudo apt-get install phpmyadmin;</code></pre>
</div>
</span></code></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-49919242956776702842014-02-23T14:27:00.000-08:002014-02-23T14:30:10.949-08:00Integrating Google ads for mobile into an android app<div dir="ltr" style="text-align: left;" trbidi="on">
makesure you have ant debug/release runs well with your application root folder with google-play-services-lib and you have creted the adUnitID for Banners/InterstitialAd with an account for your android app to monitize (to show google ads in your app and make money)<br />
<br />
Now in your application main file the class which is the etry point of your Activity or which extends CordovaACtivity you should (not necessarily true always) implement the Banners/InterstitialAd.<br />
<br />
<b>How to implement Banners</b><br />
<b><br /></b>
<br />
<blockquote>
import the following packages<br />
<br />
<blockquote class="tr_bq">
import com.google.android.gms.ads.AdRequest;<br />import com.google.android.gms.ads.AdSize;<br />import com.google.android.gms.ads.AdView;</blockquote>
<div>
<br /></div>
<div>
declare variables to hold the objects</div>
<div>
<br /></div>
<div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>private static final String AdMob_banner_Ad_Unit = "GOOGLE_ADMOB_BANNER_ID";</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>private AdView m_adView; </div>
</div>
<div>
<br /></div>
<div>
in public void onCreate(Bundle savedInstanceState) function </div>
<div>
write the below code</div>
<div>
<br /></div>
<div>
<div>
@Override</div>
<div>
public void onCreate(Bundle savedInstanceState)</div>
<div>
{</div>
<div>
super.onCreate(savedInstanceState);</div>
<div>
super.init();</div>
<div>
</div>
<div>
// Set by <content src="index.html" /> in config.xml</div>
<div>
super.loadUrl(Config.getStartUrl());</div>
<div>
//super.loadUrl("file:///android_asset/www/index.html")</div>
<div>
</div>
<div>
m_adView = new AdView(this);</div>
<div>
m_adView.setAdUnitId(AdMob_banner_Ad_Unit);</div>
<div>
m_adView.setAdSize(AdSize.BANNER);</div>
<div>
</div>
<div>
LinearLayout layout = super.root;</div>
<div>
layout.addView(m_adView); </div>
<div>
AdRequest request1 = new AdRequest.Builder().build();</div>
<div>
m_adView.loadAd(request1);</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
also update the other override methods as</div>
<div>
<br /></div>
<div>
<div>
@Override</div>
<div>
public void onPause() {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>m_adView.pause();</div>
<div>
super.onPause();</div>
<div>
}</div>
<div>
<br /></div>
<div>
@Override</div>
<div>
public void onResume() {</div>
<div>
super.onResume();</div>
<div>
m_adView.resume();</div>
<div>
}</div>
<div>
<br /></div>
<div>
@Override</div>
<div>
public void onDestroy() {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>m_adView.destroy();</div>
<div>
super.onDestroy();</div>
<div>
}</div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<b>To Implement InterstitialAd</b></div>
<div>
<b><br /></b></div>
<div>
import com.google.android.gms.ads.AdListener;<br />
import com.google.android.gms.ads.AdRequest;<br />
import com.google.android.gms.ads.InterstitialAd;<br />
<div>
<br /></div>
<div>
declare variables to hold the objects</div>
<div>
<br /></div>
<div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>private InterstitialAd m_interstitial;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>private static final String AdMob_interstitial_Ad_Unit = "GOOGLE_ADDMOB_INTERSTITIAL_UNIT_ID";</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
in public void onCreate(Bundle savedInstanceState) function </div>
<div>
write the below code</div>
<div>
<br /></div>
<div>
<div>
@Override</div>
<div>
public void onCreate(Bundle savedInstanceState)</div>
<div>
{</div>
<div>
super.onCreate(savedInstanceState);</div>
<div>
super.init();</div>
<div>
super.loadUrl(Config.getStartUrl());</div>
<div>
</div>
<div>
// Create the interstitial.</div>
<div>
m_interstitial = new InterstitialAd(this);</div>
<div>
m_interstitial.setAdUnitId(AdMob_interstitial_Ad_Unit);</div>
<div>
</div>
<div>
m_interstitial.setAdListener(new AdListener() {</div>
<div>
@Override</div>
<div>
public void onAdLoaded() {</div>
<div>
//super.onAdLoaded();</div>
<div>
displayInterstitial();</div>
<div>
}</div>
<div>
<br /></div>
<div>
@Override</div>
<div>
public void onAdFailedToLoad(int errorCode) {</div>
<div>
//super.onAdFailedToLoad(errorCode);</div>
<div>
}</div>
<div>
});</div>
<div>
<br /></div>
<div>
// Create ad request.</div>
<div>
AdRequest adRequest2 = new AdRequest.Builder()</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>.build();</div>
<div>
<br /></div>
<div>
// Begin loading your interstitial.</div>
<div>
m_interstitial.loadAd(adRequest2); </div>
<div>
}</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
// Invoke displayInterstitial() when you are ready to display an interstitial.</div>
<div>
public void displayInterstitial() {</div>
<div>
if (m_interstitial.isLoaded()) {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> m_interstitial.show();</div>
<div>
}</div>
<div>
}</div>
</div>
</blockquote>
<div>
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-16530467647663528202014-02-23T14:08:00.004-08:002014-02-23T14:08:59.722-08:00integrating google_play_service with phone gap android application<div dir="ltr" style="text-align: left;" trbidi="on">
It was even very painful foe me while integrating the Google Admobs which requires google_play_services to be integrated ! here is my share of tricks how I solved the play services Build problem.<br />
<br />
When you try to publish an app you have to create a release build for which either you have to create release build with below command<br />
<br />
<ul style="text-align: left;">
<li>ant release</li>
<li>cordova build --release</li>
</ul>
<br />
If you have not built anytime the play service with ant<br />
You get the following error !<br />
<br />
D:\workspace\HTML5\Wordizy>ant debug/release<br />
Buildfile: build.xml does not exist!<br />
Build failed<br />
<br />
to fix this (ant must have been setup)<br />
copy the whole google-play-services_lib folder from ANDROID_SDK_PATH\extras\google\google_play_services\libproject\to your project root directory.<br />
copy<br />
build.xml<br />
local.properties<br />
project.properties<br />
files from root folder/Cordova lib folder to google-play-services_lib folder<br />
<br />
Change the project.properties file's project target to the right target (very important)<br />
<br />
split.density=false<br />
# Project target.<br />
target=android-19 (important)<br />
android.library=true<br />
<div>
<br /></div>
change android.library.reference.2=google-play-services_lib in your root/project project.properties file<br />
<br />
Stand on the google-play-services-lib and in the cmd editor supply<br />
<b>android update project -p .</b> (dot=current folder)<b> </b>you should not be getting any error<br />
then supply the command<br />
<b>ant debug </b>success<br />
<b>ant release</b> success<br />
<br />
Now you are done !<br />
<br />
You can also call<b> cordova build --release</b> command at the root folder of the application and it should create a unsigned-release.apk file.</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-40150044069380028052014-02-19T05:12:00.001-08:002014-02-27T11:51:59.283-08:00A Word App built with Jquery and Rest (wordizy)<div dir="ltr" style="text-align: left;" trbidi="on">
<table>
<tbody>
<tr>
<td><a href="https://play.google.com/store/apps/details?id=com.zoogaru.Wordizy" target="_blank"><img alt=" Wordizy" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyFWjAKUY5aKW3N8g3Tkg15MkS90IbspMAt1KL5Q98bCsvlBc9iKpQYzaqCgDUctf08YSKTvmjV5gdrF86L6G66dhq2_jtb2iX3l0k-Bbss3cZ7LYXUvPCoX7nNktTsDkzaciW-iIMa0s/s1600/icon.png" height="320" width="320" /></a></td>
<td><a href="http://filedir.com/android-games/brain-puzzle/wordizy-download-8938093.html" rel="nofollow" target="_blank"><img alt="Download Wordizy / Android" border="0" src="http://img.filedir.com/i/getitblack.png" height="51" width="156" /></a></td>
</tr>
<tr>
<td><a href="https://play.google.com/store/apps/details?id=com.zoogaru.Wordizy" target="_blank"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpilHBewjqvzkdP_XxngfVd_zuR35SOmTwdLwmO1SYDWXg7jLg54P7rblcEn93okZWO1XkDPSD8i8zBWg1cC1pzc3HsDayaKr6Svg4pcO3WTxbWR4gWrNJec1wUgQm7DOS4O4ayuDE7qw/s1600/playground.png" height="320" width="180" /></a></td>
<td><a href="https://play.google.com/store/apps/details?id=com.zoogaru.Wordizy" target="_blank"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3e5FfTSSz0Ihgy6pqLi8oiEqWNqnxtD89eneJVSkvxVkQqfAgQLwgJ-1A4e_MGEsRU99yBwTdLBO21qfiC3-kanPaPB9FWDnRUygTeuYdmi3nF4r7ExF4gpWfUAI2m_GIlfKLQsFKRtU/s1600/home.png" height="320" width="180" /></a></td>
</tr>
</tbody></table>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-20462566053829385542014-01-24T19:22:00.002-08:002014-02-18T10:44:24.026-08:00JqueryMobile very useful technique<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Changing the text of a button at runtime</b><br />
If you are trying to update the value of a button at run time then create the button with<br />
<input type = "button" id="total_time" value= "Time : 00.00" class="ui-btn-right"><br />
but not with <a href="" data-role="button"><br />
You get the below error<br />
can not call method of button before initialization error.<br />
<br />
<span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;">Set the </span><code style="background-color: #f0f0f0; color: #333333; font-weight: bold;">for</code><span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;"> attribute of the </span><code style="background-color: #f0f0f0; color: #333333; font-weight: bold;">label</code><span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;"> to match the ID of the </span><code style="background-color: #f0f0f0; color: #333333; font-weight: bold;">input</code><span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;"> so they are semantically associated and wrap them in a </span><code style="background-color: #f0f0f0; color: #333333; font-weight: bold;">div</code><span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;"> with the </span><code style="background-color: #f0f0f0; color: #333333; font-weight: bold;">data-role="fieldcontain"</code><span style="background-color: #f0f0f0; color: #333333; font-family: Helvetica, Arial, sans-serif;"> attribute to group them.</span><br />
<br />
<div data-role="fieldcontain"><br />
<label for="password">Password Input:</label><br />
<input type="password" name="password" id="password" value="" /><br />
</div><span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<br />
<b>Grouping and dividing content</b><br />
<b><br /></b>
jQuery Mobile provides classes <b>ui-bar</b> and <b>ui-body</b> for <i>subdividing and for visually grouping</i> content.<br />
<br />
Add class<b> ui-bar to create a full-width heading</b> or a separator between sections of content.<br />
Additionally, classes ui-bar-[a-z] add the appropriate swatch from your theme.<br />
<br />
Add <b>class ui-body to visual group and/or emphasize a section of content</b>.<br />
Additionally, classes ui-body-[a-z] add the appropriate swatch from your theme.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><div id="are_you_lost" data-inline="true" align="center"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><h3 class="ui-bar ui-bar-b ui-corner-all" id="high_scrore_header">Are You Lost ?</h3><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <div class="ui-body ui-body-b ui-corner-all"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><p>There is a keyboard for you at upper right corner !<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> </br>Click it and start playing.</br></p><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> </div><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<div>
<br />
<b>Creating a DialogBox like Popup</b><br />
<b><br /></b>
<div id="success_dialog" data-position-to="window" data-role="popup" data-history="false" data-transition="flip"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <h3 class="ui-bar">Header </h3><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> <div class="ui-body ui-body-b"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span><p>This is a content<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> </br>This is a content</br><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> </br>This is a content</br><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> <span class="Apple-tab-span" style="white-space: pre;"> </span> </br></p><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> </div><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<br />
<b>This is a better example</b><br />
<a href="#popupDialog" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop" data-icon="delete" data-theme="b">Delete page...</a><br />
<div data-role="popup" id="popupDialog" data-overlay-theme="a" data-theme="c" data-dismissible="false" style="max-width:400px;" class="ui-corner-all"><br />
<div data-role="header" data-theme="a" class="ui-corner-top"><br />
<h1>Delete Page?</h1><br />
</div><br />
<div data-role="content" data-theme="d" class="ui-corner-bottom ui-content"><br />
<h3 class="ui-title">Are you sure you want to delete this page?</h3><br />
<p>This action cannot be undone.</p><br />
<a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Cancel</a><br />
<a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Delete</a><br />
</div><br />
</div><br />
<b><br /></b></div>
<b>Creating grouped button</b><br />
<b><br /></b>
You can group buttons together and put them together in fotter/header e.g<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><div data-role="controlgroup" data-type="horizontal" class="ui-btn-left"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="quit.html" data-icon="delete" data-ajax="false" data-role="button">Quit</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type = "button" id="total_tries" value= "Tries : 0" ><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<br />
<b>Prevent ChangePage</b><br />
-----------------<br />
$(document).bind('pagebeforechange', function(e, data) {<br />
var to = data.toPage,<br />
from = data.options.fromPage;<br />
<br />
if (typeof to === 'string') {<br />
var u = $.mobile.path.parseUrl(to);<br />
to = u.hash || '#' + u.pathname.substring(1);<br />
if (from) from = '#' + from.attr('id');<br />
<br />
if (from === '#page1' && to === '#page3') {<br />
alert('Cannot change to page 3 from page 1');<br />
e.preventDefault();<br />
<br />
// remove active class on button<br />
// otherwise button would remain highlighted<br />
$.mobile.activePage<br />
.find('.ui-btn-active')<br />
.removeClass('ui-btn-active');<br />
} <br />
}<br />
});<br />
<br />
<br />
<b>How to display a scrollbar in a div</b> This is best way to display more informations in a Game<br />
<br />
$(document).on("pageinit","#pageone",function(event){<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var heightOfWindow = $(window).height();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var totalHeightOfContents = $(document).height();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>if(heightOfWindow <= totalHeightOfContents){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var contentIDHeight = $('#content_id').height();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var infoDivIDHeight = $('#info').height();<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var heightExcludingInfo = contentIDHeight - infoDivIDHeight;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var availableHeightForInfo = heightOfWindow - heightExcludingInfo;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>var test = availableHeightForInfo - 420;<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$('#info').height(test);<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>});<br />
<div>
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-9342270817964224032014-01-21T12:16:00.001-08:002014-01-21T12:16:22.799-08:00JqueryMobile Headers Footer Navigation Bars<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Create own custom Header/Fotter Bars</b><br />
<br />
<div data-role="footer" <b>class="ui-bar"</b>><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="index.html" data-role="button" data-icon="plus">Add</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="index.html" data-role="button" data-icon="arrow-u">Up</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="index.html" data-role="button" data-icon="arrow-d" class="ui-btn-right">Down</a><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<br />
<span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">Note that </span><code style="background-color: #f9f9f9; color: #333333;">.ui-bar</code><span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;"> should not be added to header or footer bars that span the full width of the page</span><br />
<span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;"><br /></span>
<span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;"><br /></span>
<span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;"><b>To Create FullScreen Headers which goes away in fullscreen mode</b></span><br />
<div data-role="header" <span style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">data-fullscreen="true"</span>><br />
<br />
<b>Alignment and grouping</b><br />
To align all elements center in the header/footer use alighn="center" style<br />
<div data-role="header" align="center" data-position="fixed"><br />
<br />
use data-role="controlgroup" for grouping the buttons in headers or footers<br />
<br />
<div data-role="footer" id="id_footer" data-position="fixed"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><div data-role="controlgroup" data-type="horizontal"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type = "button" id="total_tries" value= "Tries : 0"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type = "button" id="total_giveup" value= "GiveUp"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><input type = "button" id="total_time" class="ui-btn-right"><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span></div><br />
<br />
<b>Navbar</b><br />
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
A navbar is coded as an unordered list of links wrapped in a container element that has the <code style="font-size: 1.2em; font-weight: bold;">data-role="navbar"</code> attribute. This is an example of a two-button navbar:</div>
<pre style="background-color: #f9f9f9; color: #333333; white-space: pre-wrap; word-wrap: break-word;"><code>
<strong><div data-role="navbar"></strong>
<ul>
<li><a href="a.html">One</a></li>
<li><a href="b.html">Two</a></li>
</ul>
<strong></div><!-- /navbar --></strong></code></pre>
<pre style="background-color: #f9f9f9; color: #333333; white-space: pre-wrap; word-wrap: break-word;"><code><strong>
</strong></code></pre>
<b>Navbar in Headers</b><br />
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
If you want to add a navbar to the top of the page, you can still have a page title and buttons. Just add the navbar container inside the header block, right after the title and buttons in the source order.</div>
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
<br /></div>
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
<b>Persistent navbar</b></div>
<div style="background-color: #f9f9f9;">
<span style="color: #333333; font-family: Helvetica, Arial, sans-serif;">There is also a persistent navbar variation that works more like a tab bar that stays fixed as you navigate across pages. </span><span style="color: #333333; font-family: Helvetica, Arial, sans-serif;">To tell the framework to apply the persistent behavior, add the same <b>data-id</b> </span><span style="color: #333333; font-family: Helvetica, Arial, sans-serif;">attribute to the header and/or footer of all HTML pages in the navigation</span></div>
<div style="background-color: #f9f9f9;">
<span style="color: #333333; font-family: Helvetica, Arial, sans-serif;"><br /></span></div>
<pre style="background-color: #f9f9f9; color: #333333; white-space: pre-wrap; word-wrap: break-word;"><code><div data-role="footer"<strong> </strong>data-id="foo1"<strong> data-position="fixed"</strong>>
<div data-role="navbar">
<ul>
<li><a href="a.html">Info</a></li>
<li><a href="b.html">Friends</a></li>
<li><a href="c.html">Albums</a></li>
<li><a href="d.html">Emails</a></li>
</ul>
</div><!-- /navbar -->
</div><!-- /footer --></code></pre>
<div style="background-color: #f9f9f9;">
<span style="color: #333333; font-family: Helvetica, Arial, sans-serif;"><br /></span></div>
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
To set the active state of an item in a persistent toolbar, add <code style="font-size: 1.2em; font-weight: bold;">class="ui-btn-active ui-state-persist"</code> to the corresponding anchor.</div>
<pre style="background-color: #f9f9f9; color: #333333; white-space: pre-wrap; word-wrap: break-word;"><code>
<li><a href="a.html" <strong>class="ui-btn-active ui-state-persist"</strong>>Info</a></li></code></pre>
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
<br /></div>
<div style="background-color: #f9f9f9; color: #333333; font-family: Helvetica, Arial, sans-serif;">
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-72084739964013891272014-01-18T13:48:00.002-08:002014-03-23T20:56:04.735-07:00Creating an Application using PhoneGap (Cordova) with target android<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Install Node js</b> will install npm and other necessary component for phonegap utility<br />
<b>Install PhoneGap :</b> npm install -g phonegap<br />
<b>Install Cordova :</b> npm install -g phonegap<br />
<br />
<b>Go to Your Workspace Directory and Create a cordova project</b><br />
<br />
cordova create CowsBulls com.zoogaru.games CowsBulls -d<br />
<br />
<code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">-d</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"> option displays information about its progress.</span><br />
<br />
It Creates following forlders<br />
<br />
.cordova<br />
merges<br />
platforms --- all added platform code goes here..<br />
plugins --- all installed plugins sits here<br />
www --- root directory for the application assets like css, img, html, js present<br />
<br />
<b>WWW </b>Folder<br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">subdirectory houses your application's home page, along with various resources under </span><code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">css</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">, </span><code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">js</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">, and </span><code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">img</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">, which follow common web development file-naming conventions</span><br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><b>Setting up for Android</b></span><br />
Pre-requiste -- Android platform is available and emulator device setup is done<br />
<br />
Set up environment variables<br />
Create A UserVariable ANDROID_TOOLS = D:\Android\sdk\platform-tools;D:\Android\sdk\tools<br />
Add it to Path variable = PATH;ANDROID_TOOLS<br />
<br />
Install Java SDK and set path unless java runs from command line<br />
<br />
<b>Install ant from below link zip version or which ever is applicable for your os</b><br />
http://ant.apache.org/bindownload.cgi<br />
Follow instructions at http://ant.apache.org/manual/install.html to setup ant<br />
<br />
<span style="background-color: #eeeeee;">The ant.bat script makes use of three environment variables - ANT_HOME, CLASSPATH and JAVA_HOME. </span><b>Ensure</b><span style="background-color: #eeeeee;"> that ANT_HOME and JAVA_HOME variables are set, and that they do </span><b><u>not</u></b><span style="background-color: #eeeeee;"> have quotes (either ' or ") and they do </span><b><u>not</u></b><span style="background-color: #eeeeee;"> end with \ or with /. CLASSPATH should be unset or empty.</span><br />
<span style="background-color: #eeeeee;"><br /></span>
<span style="background-color: #eeeeee;">Create ANT_HOME</span><br />
<span style="background-color: #eeeeee;">Create JAVA_HOME</span><br />
<span style="background-color: #eeeeee;"><br /></span>
<span style="background-color: #efefef;">set ANT_HOME=c:\ant</span><br />
<pre style="background-color: #efefef;">set JAVA_HOME=c:\jdk1.7.0_51
set PATH=%PATH%;%ANT_HOME%\bin</pre>
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><b>Now Check the ANT SetUp</b></span><br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
You can check the basic installation with opening a new shell and typing <tt>ant</tt>. You should get a message like this<br />
<pre style="background-color: #efefef;">Buildfile: build.xml does not exist!
Build failed
</pre>
<b>So Ant works.</b> This message is there because you need to write an individual buildfile for your project. With a <tt>ant -version</tt> you should get an output like<br />
<br />
<b>add android platform</b><br />
D:\workspace\HTML5\CowsBulls>cordova platform add android<br />
Creating android project...<br />
Preparing android project<br />
<br />
<b>build</b><br />
D:\workspace\HTML5\CowsBulls>cordova build<br />
Generating config.xml from defaults for platform "android"<br />
Preparing android project<br />
Compiling app on platform "android" via command "cmd" /c D:\workspace\HTML5\Cows<br />
Bulls\platforms\android\cordova\build<br />
Platform "android" compiled successfully.<br />
<br />
<b>run in device</b><br />
D:\workspace\HTML5\CowsBulls>cordova run<br />
Generating config.xml from defaults for platform "android"<br />
Preparing android project<br />
Running app on platform "android" via command "cmd" /c D:\workspace\HTML5\CowsBu<br />
lls\platforms\android\cordova\run --device<br />
Platform "android" ran successfully.<br />
<br />
<b>Our Application might use internet so enable internet plugin</b><br />
install git command line tool from http://git-scm.com/<b><br /></b>
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">Access files on device or network (</span><a href="http://docs.phonegap.com/en/edge/cordova_file_file.md.html#File" style="background-color: #f6f4f2; color: #f06433; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px; text-decoration: none; text-shadow: rgb(255, 255, 255) 0px 1px 0px;">File</a><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"> API):</span><br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">D:\workspace\HTML5\CowsBulls>phonegap local plugin add https://git-wip-us.apache</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">.org/repos/asf/cordova-plugin-file.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] adding the plugin: https://git-wip-us.apache.org/repos/asf/cordova-pl</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">ugin-file.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] successfully added the plugin</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">D:\workspace\HTML5\CowsBulls>phonegap local plugin add https://git-wip-us.apache</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">.org/repos/asf/cordova-plugin-vibration.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] adding the plugin: https://git-wip-us.apache.org/repos/asf/cordova-pl</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">ugin-vibration.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="background-color: #f6f4f2; line-height: 20.799999237060547px;"></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] successfully added the plugin</span></span><br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<br />
<div>
<b>Add DialogBox and Vibration tool for notifications</b></div>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">D:\workspace\HTML5\CowsBulls>phonegap local plugin add https://git-wip-us.apache</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">.org/repos/asf/cordova-plugin-dialogs.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] adding the plugin: https://git-wip-us.apache.org/repos/asf/cordova-pl</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">ugin-dialogs.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="background-color: #f6f4f2; line-height: 20.799999237060547px;"></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] successfully added the plugin</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><b>Open new browser windows (InAppBrowser):</b></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><b>Debug console:</b></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="line-height: 20.799999237060547px;"><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><b>To List all Plugins</b></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">D:\workspace\HTML5\CowsBulls> phonegap local plugin list</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] org.apache.cordova.console</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] org.apache.cordova.dialogs</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] org.apache.cordova.file</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] org.apache.cordova.inappbrowser</span></span><br />
<span style="line-height: 20.799999237060547px;"><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"></span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;">[phonegap] org.apache.cordova.vibration</span></span><br />
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;"><span style="line-height: 20.799999237060547px;"><br /></span></span>
<span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small; line-height: 20.799999237060547px;"><b>The config.xml File</b></span><br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">Many aspects of an app's behavior can be controlled with a global configuration file, </span><code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">config.xml</code><br />
<code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">config.xml</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"> file can be found in the top-level </span><code style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; padding: 2px 4px; white-space: pre-wrap;">www</code><span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"> directory</span><br />
D:\workspace\HTML5\CowsBulls\www<br />
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;"><br /></span>
<span style="background-color: #f6f4f2; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 20.799999237060547px;">Read ..</span><br />
<span style="background-color: #f6f4f2; line-height: 20.799999237060547px;"><span style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: x-small;">http://docs.phonegap.com/en/edge/config_ref_index.md.html#The%20config.xml%20File</span></span><br />
<br />
Setting Global Level preferences<br />
Full Screen true/false and Orientation <span style="background-color: #f6f4f2; font-family: DejaVu, Monaco, 'Courier New', Courier; font-size: 12px; line-height: 20.799999237060547px; white-space: pre-wrap;">portrait/landscape</span><br />
<preference name="Fullscreen" value="true" /><br />
<preference name="Orientation" value="landscape" /><br />
<br />
The came config gets copied to the folder<br />
D:\workspace\HTML5\CowsBulls\platforms\android\assets\www<br />
<br />
<b>There is also one config file which android specific</b><br />
D:\workspace\HTML5\CowsBulls\platforms\android\res\xml\<br />
where you see device specific plugin informations are added e.g<br />
<feature name="Notification"><br />
<param name="android-package" value="org.apache.cordova.dialogs.Notification" /><br />
</feature><br />
<br />
<b>NOW LETS ENABLE OUR HTML5 GAME in Cordova</b><br />
<b><br /></b>
drop all the html file to application/www folder<br />
run the cordova build command<br />
Check all the files got copeid to<br />
D:\workspace\HTML5\CowsBulls\platforms\android\assets\www<br />
<br />
Change the <content src="index.html" /> to<br />
<content src="home.html" /> to point to your application landing page<br />
<br />
And you are done !!<br />
<br />
<b>Now Create a Icon for the android</b><br />
create a image icon using GIMP or photoshop<br />
use the android asset tool and generate icon from the image.<br />
use http://makeappicon.com/ for creating icon for android/ihone device<br />
<br />
<b>Splash Screen</b><br />
http://android-ui-utils.googlecode.com/hg/asset-studio/dist/nine-patches.html<br />
<br />
<b>Create the release version</b><br />
cordova build --release<br />
<br />
<b>Signing process</b><br />
<pre class="prettyprint" style="background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); color: #006600; font-size: 13px; line-height: 1.5; margin-bottom: 1em; overflow: auto; padding: 1em;"><span class="pln" style="color: black;">keytool </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">genkey </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">v </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keystore </span><span class="kwd" style="color: #000088;">my</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">release</span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">key</span><span class="pun" style="color: #666600;">.</span><span class="pln" style="color: black;">keystore</span><span class="pun" style="color: #666600;">-</span><span class="kwd" style="color: #000088;">alias</span><span class="pln" style="color: black;"> alias_name </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keyalg RSA </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">keysize </span><span class="lit" style="color: #006666;">2048</span><span class="pln" style="color: black;"> </span><span class="pun" style="color: #666600;">-</span><span class="pln" style="color: black;">validity </span><span class="lit" style="color: #006666;">10000</span></pre>
<pre class="prettyprint" style="background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); margin-bottom: 1em; overflow: auto; padding: 1em;"><span class="lit" style="line-height: 19.5px;"><span style="color: #006666;">jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name</span></span></pre>
<pre class="prettyprint" style="background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); margin-bottom: 1em; overflow: auto; padding: 1em;"><span class="lit" style="line-height: 19.5px;"><span style="color: #006666;">jarsigner -verify my_signed.apk</span></span></pre>
<pre class="prettyprint" style="background-color: #f7f7f7; border: 1px solid rgb(221, 221, 221); margin-bottom: 1em; overflow: auto; padding: 1em;"><span class="lit" style="line-height: 19.5px;"><span style="color: #006666;">zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk</span></span></pre>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-37051490087142547062014-01-18T11:56:00.000-08:002014-01-28T08:42:23.422-08:00HTML5 Page Linking, Navigation, Pagechange, Load<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Linking external pages or different page resource in the same domain</b><br />
<br />
Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with AJAX. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via AJAX. Because of security restrictions, the framework always opts links to external domains out of the AJAX behavior.<br />
<br />
It's important to note that if you are linking from a mobile page that was loaded via AJAX to a page that contains multiple internal pages, you need to add a rel="external" or data-ajax="false" to the link. This tells the framework to do a full page reload to clear out the AJAX hash in the URL. This is critical because AJAX pages use the hash (#) to track the AJAX history, while multiple internal pages use the hash to indicate internal pages so there will be conflicts in the hash between these two modes.<br />
<br />
For example, a link to a page containing multiple internal pages would look like this:<br />
<a href="multipage.html" rel="external">Multi-page link</a><br />
<br />
When linking to directories, without a filename URL, (such as href="typesofcats/" instead ofhref="typesofcats/index.html"), you must provide a trailing slash. This is because jQuery Mobile assumes the section after the last "/" character in a URL is a filename, and it will remove that section when creating base URLs from which future pages will be referenced.<br />
Documents loaded via AJAX will select the first page in the DOM of that document to be loaded as a jQuery Mobile page element. As a result the developer must make sure to manage the id attributes of the loaded page and child elements to prevent confusion when manipulating the DOM.<br />
If you link to a multipage document, you must use a data-ajax="false" attribute on the link to cause a full page refresh due to the limitation above where we only load the first page node in an AJAX request due to potential hash collisions<br />
<br />
While linking pages inside a multipage template, you should not use the data-ajax="false" attribute as it is of no use and will only interfere with the transition settings.<br />
The "ui-page" key name used in sub-hash URL references can be set to any value you'd like, so as to blend into your URL structure. This value is stored in jQuery.mobile.subPageUrlKey.<br />
jQuery Mobile Load Events<br />
Page load events are for external pages.<br />
Whenever an external page is loaded into the DOM, 2 events fire. The first is pagebeforeload, and the second will either be pageload (success) or pageloadfailed (fail).<br />
These events are explained in the table below:<br />
<br />
back Button Linking<br />
<a data-rel="back" data-icon="arrow-l">Back</a><br />
<br />
You can disable button style of active buttons after stop transition<br />
$.mobile.activeBtnClass = 'unused';<br />
<br />
Serialize the form data with jQuery<br />
var serializedFormData = $('#form').serialize();<br />
Third: Post your form with $.ajax();<br />
$.ajax({<br />
url: '/countries/change_country',<br />
type: 'POST',<br />
data: serializedFormData<br />
});</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0tag:blogger.com,1999:blog-1107203471830579535.post-2925113424967602262014-01-18T10:25:00.001-08:002014-01-28T08:43:18.643-08:00Using Web Storage<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 22px; font-weight: normal; margin-bottom: 10px; margin-top: 10px;">
What is HTML5 Web Storage?</h2>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
With HTML5, web pages can store data locally within the user's browser.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
Earlier, this was done with cookies. However, Web Storage is more secure and faster. The data is not included with every server request, but used ONLY when asked for. It is also possible to store large amounts of data, without affecting the website's performance.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<br /></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
The data is stored in key/value pairs, and a web page can only access data stored by itself.</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<br /></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<span style="font-size: 22px;">localStorage and sessionStorage </span></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
There are two new objects for storing data on the client:</div>
<ul style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<li>localStorage - stores data with no expiration date</li>
</ul>
<div>
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: x-small;"><span style="line-height: 16px;"><br /></span></span></div>
<div>
<span style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.</span></div>
<ul style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<li>sessionStorage - stores data for one session</li>
</ul>
<div>
<ul style="background-color: white; font-family: arial, sans-serif; font-size: 13px; max-width: 62em; padding-left: 25px;">
<li style="margin-bottom: 0.3em;">it persists in the same tab, being the origin of the context, and in every page surfed inside the tab, so it could be extremely unsafe to trust it for important data</li>
<li style="margin-bottom: 0.3em;">it is automatically cleaned as soon as we close the tab or the browser, so used RAM will be automatically cleaned and without scripting effort</li>
</ul>
</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
Before using web storage, check browser support for localStorage and sessionStorage:</div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;">if(typeof(Storage)!=="undefined")</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> {</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> // localStorage and sessionStorage code goes here</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> }</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;">else</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> {</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> // Your Webbrowser doesn't support webstorage !</span><br />
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"> }</span></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; font-size: 13px; line-height: 16px;">
<span style="background-color: #f6f4f0; color: #444444; font-family: 'courier new'; font-size: 14px; line-height: normal;"><br /></span></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; line-height: 16px;">
<b>We are going to use Session storage to save username and password. </b></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; line-height: 16px;">
<br /></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> function getServerPwd(aName) {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> if (typeof (Storage) !== "undefined") {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> if (!sessionStorage.user_name) {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> sessionStorage.user_name = aName;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> sessionStorage.user_pwd = getHashPwd(aName);</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> }</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> return sessionStorage.user_pwd;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> }</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> else {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> alert("browser doesn't support session data !");</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> }</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> return "";</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> }</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><br /></span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> function getHashPwd(aName)</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><br /></span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>var hash = 0, i, char;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> if (aName.length == 0) return hash;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> for (i = 0, l = aName.length; i < l; i++) {</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> char = aName.charCodeAt(i);</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> hash = ((hash<<5)-hash)+char;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> hash |= 0; // Convert to 32bit integer</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> }</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>return hash;</span></span></div>
<div style="background-color: white;">
<span style="color: #404040; font-family: verdana, helvetica, arial, sans-serif;"><span style="line-height: 16px;"> }</span></span></div>
<div style="background-color: white;">
<br /></div>
<div style="background-color: white; color: #404040; font-family: verdana, helvetica, arial, sans-serif; line-height: 16px;">
<br /></div>
</div>
Sandeephttp://www.blogger.com/profile/06699193938523218566noreply@blogger.com0