Skip to main content

Posts

Using simple html in android

In an app, instead of using a textview, we can use a webview. Why? Because webview is better looking. And, more importantly, we can format the text easily - specifically for long, long text. And, yes, it has an automatic scroll controls. Now how do we display a static text in a webview?  String str="your text here"; webview.loadData(str,"text/html",null); But your string should also have html tags in them. The simplest tags are html and body. So surround your string with these. String str="your text here"; String str = "<html><body>"+str+"</body>"; webview.loadData(str,"text/html",null); But if you are using for formatting the text, like bold , italic , different font etc. to be used for some parts of the text? How do you get that done?  The straight forward solution is learn html and hand code all the B 's and slash B's etc. yourself.  Of course, I am kidding. There are plent...

Adding custom view to xml

You wanted to write your own custom view. You wrote it extending View class or better still TextView or ImageView class. You even added this view within your activity using Java code an d tested it successful ly. But adding views with Java is a lengthy process and is cumbersome. xml makes the process easier.  So how do you add your custom view into your layout xml file? somelayout.xml  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- Other Views --> <com.some.name.CustomView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/cell1"/> <!-- Other Views --> </LinearLayo...

An app and a story

An app and a story I am not writing anything about coding tip here. But telling you how my app Shataka came into existence.  Few years back, I had started an app, whose idea was to find all combinations of numbers to get the required sum. Something like,  90 = 10*9      = 45*2      = 200 -110 etc. Then the app was killed because my computer was. I did not have a single line of code remaining.  That was metamorphasized into this unique app Shataka. As far as I know, in android market there are not many number games for adults. There are few me-too versions of 2048 and few apps which ask you to type what is 10 +2 etc. But in this app, the sum was to be 100, for rows and columns. And typing the numbers is clumsy and guessing 9 numbers to fill in 3 by 3 grid for this is too time consuming. So what if I provide the numbers after shuffling them? Yes. I provide 9 numbers which if arranged in an order, make a grid wi...

Shataka updated

A completely original math game "Shataka" was published in Oct' 2014. The apps age faster than us:) So the design and UI were looking quite old. Hence an update has been published on March 14th Here are the new features Were you bored with adding to 100 always? Don't worry. In the new version you can arrange numbers so that they add to 1000. And there are also levels where sum is a random 2 digit number - different number each time. Isn't it exciting? Believe in fast work? For you, there is timed mode. You have to finish a level in 50 seconds. And if you finish much earlier, the remaining time is added as a bonus in next level. Do you need a hint? I do not ask you to purchase one. You can use a hint - again one hint per level which is accumulated if unused. Does it look quite exciting? Download the game now and start playing!!!

Screen recording of your apps

You want to publish your app. And you feel the app installs may improve after you add a promo video. But you are a one-man(or woman) team. And you rarely know anything about creating a video. What do you do? Screen recording comes to your rescue. You can record your phone screen activities into a video file. All you need is simple android adb tool. Connect your phone to the laptop. Go to command prompt.  Locate the directory where adb command is present. Normally it is yoursdkdirectory/platform-tools. And give the command on c adb devices You should be able to see your phone listed there. Next you give command adb shell screenrecord /sdcard/yourfilename.mp4 Now the screen record will start.  End it by pressing ^c The recorded video will be stored in your sdcard. Copy this to your laptop and you can edit it using moviemaker software in windows The problem with above method is audio will not be recorded and you have to add it in moviemaker. There are ma...

Enabling USB debugging on your phone

Coming here after a very very long time. Today let us see how to become a developer. I am kidding. Let us talk about how to enable your device to be connected for debugging in android studio. You need to install a samsung adb driver for your laptop first of all. Or which phone your brand is. Next take your phone - go to Settings About Device Build Number - tap on this like 10 times. And your phone tells you now you are a developer.  Great isn't it. No studying needed. Do you see your phone in android studio, when you connect to through usb? No, not yet. Because there is one more step to be done. Now settings has Developer options in it. Goto   Settings Developer Options USB debugging - check on this Done !!!  Now you can debug your android app on your phone.

Indian Newspapers and magazines - new version released

I have published version 2.0 of my Indian Newspapers and magazines app for android phone to google play. I have added many more papers in regional languages and many more magazines as well. But you don't have to worry about clutter of all those papers on screen. You can select and deselect only those papers you need. As is the new tradition, the categories are displayed as action bar tabs. So you can swipe them.  And the option to save the files for offline reading is present. As some user had commented on advertisement filling lot of real estate on screen, I have tried reducing ad sizes on my part. But some papers publish their own huge ads which are not in my control.  The version does not support android 2.2 as google play has some problems with that. I took that risk as most of the users are having newer versions of android. And another omission has been ability to add news papers. I will certainly add that feature in the next bug fix release within a fortnigh...