Skip to main content

Posts

New Akshara keyboard

If you are looking for a keyboard which lets you type in Kannada using a simple QWERTY keyboard, Akshara transliteration is your answer. To download, click on the image below.  Main features of the app are Supports Kannada and Hindi. And of course English Has transliteration keyboards as well as keyboards with Kannada/ Hindi letters Has predictions in all 3 languages Number keyboards in Kannada, Hindi and English 4 different themes  A simple note pad to type and save your thoughts in your language. This note pad works even if your phone does not have proper font Please note that You should have Kannada/Hindi fonts in your phone to use the app. Some phones like lenovo, micromax etc, do not display complex kannada fonts correctly.

R.layout.... compilation errors

You are working in your android project. Everything was fine. Suddenly you start getting lot of errors. The errors are in all the lines which use R like R.layout, R.drawable etc. Just check your import statements. Most probably there is an import which says import android.R; Hence all the resources are tried in android.R., Not in your R.java file.  Remove the import statements. And all these compilations errors vanish 

Accessing sqlite database in the command prompt

Many a times working with sqlite database, you often wonder if the tables are created, whether they are populated etc. If you want to find out the contents of the database, here are the steps needed  Start running your application using emulator or device Open command prompt. Run->cmd->click on cmd Give command adb shell If adb gives unknown command error, you can go to the folder <your androidsdk location>/platform-tools and then try giving the adb shell command. Change to directory /data/data using cd /data/data Now go to directory of your application package. e.g. if package name is com.example.dbtest, give the command cd com.example.dbtest  Change to databases directory. cd databases Open the database using sqlite3 command. If your database name is example, use the command sqlite3 example Sqlite will start. Some basic commands you can use are .quit - come out of sqlite .table - list the tables .schema tablename - list the columns of the ta...

Admob in landscape view

If you are using admob and use size as banner, it works fine in portrait mode. But in landscape mode, the advertisement will be only half filling in landscape mode. And in larger phones, even portrait modes will not show full sized ad. To overcome this, we should use SMART_BANNER size. And make sure that the width and height of adview are wrap_content. So here is the xml file to use adview. <com.google.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" ads:adSize="SMART_BANNER" ads:adUnitId="a150cabf1100e53" ads:loadAdOnCreate="true" /> Once these changes are made to xml file, your app will show full size ads, in phones of all sizes and in landscape and portrait view.

Progress bar with different color and text

Normally the horizontal progress bar  will display yellow color which most of you may not like. Unlike other views, changing the background for progress bar will not work. It will only change background image, but not the bar which shows the progress. There is one more property in xml, android:progressDrawable . You should change this. But the drawable must be a clip drawable . A clip drawable clips the diagram based on the value set. So let us create a file called clip.xml <?xml version="1.0" encoding="utf-8"?> <clip xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/bg" android:clipOrientation="horizontal" android:gravity="left" > </clip>  android:drawable, in this case bg is the .png or .xml picture to be used for clip drawable. It should be present in your res/drawable folder. Clip orientation horizontal and gravity left ar...

Recover from Pattern lock problem with Galaxy 551

If your phone is locked with pattern lock, and if you try different option too many times, your phone will lock out. It will display a screen with     User id     Password Which should be gmail account information. But even after providing these information, it will not unlock. If you are willing to reset your data, you have another option. Which is to factory reset using adb of android sdk Connect your phone to PC or laptop via usb cable. If you do not have android sdk, download it to your computer. Open command prompt on PC, by typing cmd in run command Go to the android sdk directory and then platform-tools directory Now type      adb reboot recovery  in the command shell in the command shell Your phone screen should look somewhat similar to this diagram. Open the keyboard of your phone Use ALT key of phone to scroll through options.  Go to wipe data and factory reset Type left shift key of ...

Shuffling a list in Java

I had a list of words which I wanted to shuffle in random order. When I tried swapping random elements of the list, I needed two random numbers and ensure they are not equal. Was taking a lot of time. But here is a better way private ArrayList shuffleWordList(ArrayList wrdList) { ArrayList lst = new ArrayList(); ArrayList tempList = (ArrayList) wrdList.clone(); int sz = wrdList.size(); for (int i = 0; i < sz; i++) { int listSize = tempList.size(); int n = random.nextInt(listSize); lst.add(tempList.get(n));//fill random word into new list tempList.remove(n);//remove selected word } return lst; } What we are doing here is,  Copy the list into a temporary list - tempList  Create another empty list- lst  Select one random word from temporary list  Add this word to new list  Remove the word from temporary list        Repeat ...