Sunday, December 25, 2011

Transliteration Keyboard

Many of us who have capability to read and write out native language on our Android devices are unable to do so just because we are not comfortable with variety of keyboard layout for our languages.

Well it has been a problem for me... I had been wondering that if there was a way by which i could write Hindi on my android device.

So, i made it... :)

Use the above URL to download an application named UKeyboard.


How it works?
UKeyboard is a unique application which gives its user liberty to type on English keyboard and find suggestion in his / her native language.

Application support majority of languages including Russian and Chinese.


How to set it up?
1. Select your language.
Open the UKeyboard app and select the language you want to use your keyboard for.

2. Just like any keyboard. you need to allow it from your settings.

Settings -> Language & Input -> Check UKeyboard 

you are half way done...

Go to any text input field. -> press long click -> choose UKeyboard

That't it.
No type and enjoy.

Do remember, UKeyboard uses internet to fetch the correct relevant sugestions, hence 
1. It may be a little laggy
2. Do not use this when you need to type password / Credit card / Debit card info.









Sunday, December 18, 2011

ICS update for Nexus S

Yes you heard it right....

Nexus S GSM phone update for Android 4.0 aka ICS(Iceream Sandwitch) is OUT...

Here's the method to get it.... ;D

1. Download this to your SD card of your phone. Link
2. Re-name it to update, and put it at root node in SD card.
3. Power off the device and then restart your phone with pressing volume up button.
4. Select recovery and press power button
5. Once the triangle appears, press power key and press volume up button.
6. Select the apply from sd card and choose update.zip.
7. Once done simply reboot.


Congratulations you are new ICS owner.

Friday, December 9, 2011

Printing Docs from phone.

Did you ever wanted some freaky way by which you could just print some documents / pictures right away from your mobile.
Google recently announced its new service known as Google Cloud Print.



WHAT IS CLOUD PRINT AND HOW IT WORKS?
Google cloud print is a service which gives you liberty to use and share your printer in a more efficient way.
All you need is
1. A computer with Google chrome*
2. Make sure you have Microsoft XML paper specification pack installed in your system.
3. A printer
4. Internet

* In case your printer is a not having cloud support (Which we all usually dont have in our home printers)

Now if you got all these all you need to do is
1. Setup normal printing environment for yourself.
2. Open google chrome and look for an option Google Cloud Print under the "Under the Hood/ Bonnet" tab in Option menu.
3. Sign in with you Google account.

Note: you can visit Google Cloud Print Help page for more details on configuring.

Once done.. you are ready to roll...
You can now use your android, iphone any smart phone to print Images / Documents right from your mobile.
Not only this you can print from any computer around the word.
Just open the url http://www.google.com/cloudprint and click on the Print button.
Add your file that you want to print.

In case the internet is not available or printer is not connected. The print job will be saved on the cloud and completed when the printing conditions are met :)

Hope you will take some good advantages of this tech.

enjoy


Friday, November 25, 2011

Treat for Tester friends :)

Testing is one of the most critical aspect of any application development.
So, Here is something for all my tester friends who are in high need of some image capture too for android.

I have attached two files Abhi.py and Abhi.bat,

All you have to do is to add these files in your exsisting tools folder of Android-sdk

and run abhi.bat

WHAT WILL IT DO?

well ..good question :)
It ask you some basic params like (How many snapshots you want to take and where you want to save)
Remeber 1 snapshot = 1sec so if you want to record your application on device you can simply start the abhi.bat with 500 value and it will keep on taking the snaps.

By default it will create capture folder in your D drive and if this folder already exsists it will override that folder (so do remember to take backups )

You can terminate the application t any point of time my simply closing thw window opened by this bat. :)


Abhi.py 
Abhi.bat

Hope it comes use full   :)

Wednesday, November 16, 2011

Open Source Library for Parsing data

Hey everyone,
Today i have launched yet another library for all developers.
                         Of'course its free :)
The library indends to solve a redundant problem of writing parsers in order to parse downloaded XML file.

Please let me know your suggestions in order to improve it further more.
You can get the source at xml-data-parser Source Link.


Hope it will come handy when you need to parse multiple XML's.
And do not forget to report a bug in case you face any issue. You are most welcome to contribute if you feel like doing the same.


Please let me know if you are interested in enhancing the library further more.



Tuesday, November 15, 2011

Adding dynamic data to spinners (Android)


Many a times we find that it becomes quite hard to work with some simplest looking stuffs, and then we try to find out the hardest possible ways for working with them.

I wont say its easiest but yeah its quite handy for people who wanna show dynamic data in a Spinner widget in Android.

Assumptions:
1. You are using ArrayList<DataType> dynamicData;
2. You have overriden toString function in your data class which holds the dynamic data.
class DataType{
   String spinnerElement; 


   @Override
   public String toString(){
        return spinnerElement;
   }
}
3. You know Android development :D


///////////////////////////////////////////////////////////////////////IMPLEMENTATION///////////////////////////////////////////////
Object[] items = dynamicData.toArray();
String[] elements= new String[items.length + 1];
for (int iTemp = 0; iTemp < items.length + 1; iTemp++) {
if (i == 0) {
elements[i] = "Please select";
} else {
elements[i] = ((DataType) items[i - 1]).toString();
}
}
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_spinner_item, prices);


// you can also use the default android.R.layout.single_line_spinner
// In order to support multi-line selection i have modified the source of default.


arrayAdapter .setDropDownViewResource(R.layout.single_line_spinner);
((Spinner) findViewById(R.id.mySpinner)).setAdapter(arrayAdapter );

//////////////////////////////////////////////////////////////////////////THATS IT /////////////////////////////////////////////////////////////////

R.layout.single_line_spinner
/**
Do not modify this source as the spinner uses this id only
*/

<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:singleLine="false"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:ellipsize="marquee" />

Let me know what you think about it or if have any better idea for the same.

Monday, September 26, 2011

Nexus S 4g 2.3.5 & 2.3.7, Nexus S 2.3.6 updates

Before you start updating, you should know if your phone needs an update or not?
Google released its 2.3.5 update for Nexus 4g which had a fix related to 3g singals and wifi which was not a issue in its 3G Nexus, So dont complaint about your phone not getting 2.3.5 update.

For Nexus S 3g Google rolled out 2.3.6 update which had fix for certain builds of phone related to voice search. So only the phones with this issues will be getting this update on their devices.

So before you update your phone please verify the phone falls in below mentioned category.
in case there is an error in updating (Certificate error) don't worry this one is not for you. :) May be you deserve a better update. So relax.

So go in your phone Settings, click on About Phone and check for following:

Nexus S 4G:
Version 2.3.7 : Build Number GRJ90 (2.3.5) model: Nexus D720  - > GWK74 (2.3.7) Released
Version 2.3.5:  Build Number GRJ22 (2.3.4) model: Nexus D720 -> GRJ90 (2.3.5) Released

Nexus S 3G:

Version 2.3.6: Build Number  GRJ22(2.3.4)  model : I9020A -> (2.3.6) Released


Update Procedure: 
1. Download the files from the provided link.
2. Rename to update and paste it at root of sdcard
3. Shutdown your phone.
4. While holding the volume up, press the power to turn on the phone.
5. use the up/down volume to select recovery press power to make the selection.
6. Your phone will now reboot into recovery.
7. When you see the little droid, while holding the power, press the volume up to bring up a menu.
8. Select "Apply update from /sdcard"
9. Scroll down to the update file you downloaded it, make sure it's highlighted then press power to select.

The update should be performed smoothly. In case the update is not performing this means only 2 things
1. Wrong version
2. Your phone is rooted. 

For rest of you you already are at top of Hierarchy for now as there is no new version for you.

Cheers... :)

Wednesday, September 21, 2011

Join Hangout from Google+ Mobile App

This is the feature i have been desperately waiting for.
Google plus announced its hangout feature for mobile phones.
Now you can join in the Hangout sessions via Google+ Mobile application.

This brings happiness to loads of user who have been willing to use it on their devices.
Hope you gonna use it to max :)

Monday, September 5, 2011

Android Infinite Looping Gallery


Hey there,
For a very long time i had been watching people struggling for developing a Infinite Looping Gallery in Android.

Saw very different solutions... some seriously complicated and some ... Not even close to solutions. So, drafted a small snippet which details about how you can create your (Virtually) Infinite Gallery.

Virtually -> No we are not going to use any thing like Integer.MAX_VALUE for number of elements in the list. No crazy circular linked list or anything of that sort and yes no copy pasting from Android Source.

Enough talk, lets code :D

All you need is a Gallery from android and some small peice of code.

Associate this listener to your Gallery

/**
* Copyright [2011] [Abhinava Srivastava]
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

// Constants
public final static int ADDED_EXTRA = 6;
public final static int[] mImageIds = {R.drawable.a,R.drawable.b,R.drawable.c,
R.drawable.d,R.drawable.e,R.drawable.f,
R.drawable.g,R.drawable.h,R.drawable.i,
R.drawable.j,R.drawable.k,R.drawable.l,
R.drawable.m,R.drawable.n};


// Associate it to your gallery.

private OnItemSelectedListener listner = new OnItemSelectedListener() {


public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
if (arg2 < ImageAdapter.ADDED_EXTRA / 2)
((Gallery) findViewById(R.id.gallery1)).setSelection(
mImageIds.length + 2, false);
if (arg2 > mImageIds.length + ImageAdapter.ADDED_EXTRA / 2) {
((Gallery) findViewById(R.id.gallery1)).setSelection(4, false);
}
}


public void onNothingSelected(AdapterView<?> arg0) {
((Gallery) findViewById(R.id.gallery1)).setSelection(3, false);
}
};

In your Adapter just need to modify 2 places.

/**
* Copyright [2011] [Abhinava Srivastava]
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/


public int getCount() {
return mImageIds.length + ADDED_EXTRA;
}



public View getView(int position, View convertView, ViewGroup parent) {
if (position < ADDED_EXTRA / 2) {
position = GalleryTestActivity.mImageIds.length
- (ADDED_EXTRA / 2 - position);
} else if (position >= (GalleryTestActivity.mImageIds.length + (ADDED_EXTRA / 2))) {
position = position
- (GalleryTestActivity.mImageIds.length + (ADDED_EXTRA / 2));
} else {
position -= (ADDED_EXTRA / 2);
}
View view = convertView;
if (view == null) {
view = inflater.inflate(R.layout.items, parent, false);
}
try {
((ImageView) view)
.setImageResource(GalleryTestActivity.mImageIds[position]);
} catch (Exception e) {
Log.i("ARRAY INDEX", "Position" + position, e);
}
return view;
}



yeah that's it.. nothing more... you are ready with you infinite looping circular gallery.

Friday, September 2, 2011

Sharing your PC Internet to Android Device (Wifi)

I had been stuck in situations when i was not able to use any 3G or Wifi (Hotspot) internet (Mostly happens in companies).
So in case you want to share your internet connection to your Android devices. There is a very simple yet powerful tool known as Connectify.

YOU CAN ONLY DO THIS ON WINDOWS 7 AND ABOVE ONLY + YOUR PC SHOULD BE  WiFi ENABLED.

Very handy and easy to use tool. Best part you can use it free.
Just visit the site: www.connectify.me and download the application.

1. Install
2. Wifi is ready to be shared :D
3. Find your wifi network you just created on your mobile
4. Start browsing :)

Hope this info will be useful.


Disclaimer: Connectify is a third party tool which i recently came across, and worked very well for me. In case it is not working for you... Sorry cannot help... 

Thursday, September 1, 2011

Showing circle around a point in Android (Code)



I had been trying to draw circle around my GeoPoint on the maps. I came across several links, the only limitation in all of them was that i was not able to see my circle growing like Google maps and stuff when i zoom in my maps.

So, finally i had to do this....
Here is a reference for the same...  feel free to use it :)


 public MyOverlay(Drawable defaultMarker, Context context, GeoPoint gp) {
super(defaultMarker, context);
mContext = context;
globalGeoPoint = new GeoPoint(gp.getLatitudeE6(), gp.getLongitudeE6());
maxSizeAreaGP = new GeoPoint(gp.getLatitudeE6()+10000,
gp.getLongitudeE6());
}

private Context mContext;
private GeoPoint globalGeoPoint;
private GeoPoint maxSizeAreaGP;

@Override
public void draw(Canvas canvas, MapView mapV, boolean shadow) {
Projection projection = mapV.getProjection();
if (shadow && projection != null) {
Point pt = new Point();
projection.toPixels(globalGeoPoint, pt);
Point pt1 = new Point();
projection.toPixels(maxSizeAreaGP, pt1);
float circleRadius = (float)Math.sqrt(Math.pow(pt1.x-pt.x, 2)+Math.pow(pt1.y-pt.y, 2));
Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
circlePaint.setColor(0x186666ff);
circlePaint.setStyle(Style.FILL_AND_STROKE);
canvas.drawCircle((float) pt.x, (float) pt.y, circleRadius,
circlePaint);
circlePaint.setColor(0xff6666ff);
circlePaint.setStyle(Style.STROKE);
canvas.drawCircle((float) pt.x, (float) pt.y, circleRadius,
circlePaint);
Bitmap markerBitmap = BitmapFactory.decodeResource(
getApplicationContext().getResources(), R.drawable.pin);
canvas.drawBitmap(markerBitmap, pt.x,
pt.y - markerBitmap.getHeight(), null);
super.draw(canvas, mapV, shadow);
}

You can use the above code to show blue circle on the map around a point which will be pan able...
The size of circle will increasing according to zoom level.

Let me know if its not working for you...

Tuesday, August 23, 2011

Let the Patents War Begin... (If they really want to)


Till now it seemed that Android was in a dangerous enviroment which has lots of threats from its eco-system.
Well the acquasition of Motorola Mobility is proovinig to be a Gold mine for google in porder to resist the attacks from apple and Microsoft.

THE MOST TALKED ABOUT 18 PATENTS
With the bunch of 17k patents + 7.5K pending patents there come "18" key patents which can be enough for Google to make Apple call its hounds back.


  • US patent #5,311,516 – Paging systems using message fragmentation to redistribute traffic
  • US patent #5,319,712 – Method and apparatus for providing cryptographic protection of a data stream
  • US patent #5,490,230 – Digital speech coder having optimized signal energy parameters
  • US patent #5,572,193 –Method for authentication and protection of subscribers in telecommunications systems”
  • US patent #6,175,559 – Method for generating preamble sequences in a code division multiple access systems
  • US patent #6,359,898 – Method for performing a countdown function during a mobile-originated transfer for a packet radio system
  • US patent #5,359,317 – Method and apparatus for selectively storing a portion of a received message in a selective call receiver
  • US patent #5,636,223 – Methods of adaptive channel access attempts
  • US patent #6,246,697 – Method and system for generating a complex pseudonoise sequence for processing a code division multiple access signal
  • US patent #6,246,862 – Sensor controlled user interface for portable communication device
  • US patent #6,272,333 – Method and apparatus in a wireless communication system for controlling a delivery of data
  • US patent #7,751,826 – System and method for E911 location privacy protection
  • US patent #5,710,987 – Receiver having concealed external antenna
  • US patent #5,754,119 – Multiple pager status synchronization system and method
  • US patent #5,958,006 – Method and apparatus for communicating summarized data
  • US patent #6,008,737 – Apparatus for controlling utilization of software added to a portable communication device
  • US patent #6,101,531 – System for communicating user-selected criteria filter prepared at wireless client to communication server for filtering data transferred from host to said wireless client
  • US patent #6,377,161 – Method and apparatus in a wireless messaging system for facilitating an exchange of address information

For the starters...
One patent from 2001 disables a "touch sensitive" sensor when a smartphone is near a user’s head to prevent inadvertent hang-ups or dialing. Another from 1994 aims to increase data storage, while a third enables users to control when a global positioning system sends their location data over a network.

Well it all looks quite beautiful again for Android...

Thursday, August 18, 2011

What is Lokpal How can it Help?

Recently got a mail about the much talked about Lokpal Bill.
For starters... This is a bill presented by Indian civil society in order to overcome growing corruption in India.
Some of the advantages are discussed here...
If anyone has any other info about the same or in case any of the mentioned points seems to be incorrect please let me know.

As per wikipedia : "The Jan Lokpal Bill (Hindi: जन लोकपाल विधेयक), also referred to as the citizens' ombudsman bill, is a proposed anti-corruption law in India. It is designed to effectively deter corruption, redress grievances of citizens and protect whistle-blowers."


For your education if you do not know this ---- See how Lokpal Bill can curb the politicians
Existing System
System Proposed by civil society
No politician or senior officer ever goes to jail despite huge evidence because Anti Corruption Branch (ACB) and CBI directly come under the government. Before starting investigation or initiating prosecution in any case, they have to take permission from the same bosses, against whom the case has to be investigated.
Lokpal at centre and Lokayukta at state level will be independent bodies. ACB and CBI will be merged into these bodies. They will have power to initiate investigations and prosecution against any officer or politician without needing anyoneⳠpermission. Investigation should be completed within 1 year and trial to get over in next 1 year. Within two years, the corrupt should go to jail.
No corrupt officer is dismissed from the job because Central Vigilance Commission, which is supposed to dismiss corrupt officers, is only an advisory body. Whenever it advises government to dismiss any senior corrupt officer, its advice is never implemented.
Lokpal and Lokayukta will have complete powers to order dismissal of a corrupt officer. CVC and all departmental vigilance will be merged into Lokpal and state vigilance will be merged into Lokayukta.
No action is taken against corrupt judges because permission is required from the Chief Justice of India to even register an FIR against corrupt judges.
Lokpal & Lokayukta shall have powers to investigate and prosecute any judge without needing anyoneⳠpermission.
Nowhere to go - People expose corruption but no action is taken on their complaints.
Lokpal & Lokayukta will have to enquire into and hear every complaint.
There is so much corruption within CBI and vigilance departments. Their functioning is so secret that it encourages corruption within these agencies.
All investigations in Lokpal & Lokayukta shall be transparent. After completion of investigation, all case records shall be open to public. Complaint against any staff of Lokpal & Lokayukta shall be enquired and punishment announced within two months.
Weak and corrupt people are appointed as heads of anti-corruption agencies.
Politicians will have absolutely no say in selections of Chairperson and members of Lokpal & Lokayukta. Selections will take place through a transparent and public participatory process.
Citizens face harassment in government offices. Sometimes they are forced to pay bribes. One can only complaint to senior officers. No action is taken on complaints because senior officers also get their cut.
Lokpal & Lokayukta will get public grievances resolved in time bound manner, impose a penalty of Rs 250 per day of delay to be deducted from the salary of guilty officer and award that amount as compensation to the aggrieved citizen.
Nothing in law to recover ill gotten wealth. A corrupt person can come out of jail and enjoy that money.
Loss caused to the government due to corruption will be recovered from all accused.
Small punishment for corruption- Punishment for corruption is minimum 6 months and maximum 7 years.
Enhanced punishment - The punishment would be minimum 5 years and maximum of life imprisonment.

Attempts to draft a compromise bill, merging the Government's version and that of the civil group's version, by a committee of five Cabinet Ministers and five social activists failed. The Indian government introduced its own version of the bill in the parliament, which the activists consider to be too weak.



Difference between Government and activist drafts

Difference between Draft Lokpal Bill 2010 and Jan Lokpal Bill
Draft Lokpal Bill (2010)Jan Lokpal Bill (Citizen's Ombudsman Bill)
Lokpal will have no power to initiate suo motu action or receive complaints of corruption from the general public. It can only probe complaints forwarded by the Speaker of the Lok Sabha or the Chairman of the Rajya Sabha.Lokpal will have powers to initiate suo moto action or receive complaints of corruption from the general public.
Lokpal will only be an Advisory Body with a role limited to forwarding reports to a "Competent Authority".Lokpal will have the power to initiate prosecution of anyone found guilty.
Lokpal will have no police powers and no ability to register an FIR or proceed with criminal investigations.Lokpal will have police powers as well as the ability to register FIRs.
The CBI and Lokpal will be unconnected.Lokpal and the anti corruption wing of the CBI will be one independent body.
Punishment for corruption will be a minimum of 6 months and a maximum of up to 7 years.Punishments will be a minimum of 10 years and a maximum of up to life imprisonment.
For detailed difference you can checkout at wikipedia link : 
http://en.wikipedia.org/wiki/Jan_Lokpal_Bill#Detailed

Currently India is on the verge of writing its own fate... Lets join in ...