Thursday, December 27, 2012

Use CellObject to browse Android SQLite data contents

This will only work with Android emulators or rooted phones.


Extract it. Find net.cellobject.sqlitexmlbrowser_1.2.0.jar.

Put net.cellobject.sqlitexmlbrowser_1.2.0.jar into the eclipce plugin directory.

Restart Eclipse.

Start the emulator.

Go to DDMS

Select your device on the left panel.

Then on the right side panel, navigate to 
data/data/{your_app_package_namespace}/databases/{app_name}
Click the database icon on the top bar of this right side panel.

You should now be able to see the table schema and browse the data in the CellObject SQLite Browser.

Sunday, December 16, 2012

Android selector needs drawable instead of just background


The following will result in a crash saying that cannot inflate the drawable.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_pressed="true" android:background="#000000" />
  <item android:state_focused="true" android:background="#000000" />
  <item android:background="#FFFFFF" />
</selector>

The solution is to change the background to use drawable

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_pressed="true" android:drawable="@color/grey" />
  <item android:state_focused="true" android:drawable="@color/grey" />
  <item android:drawable="@color/white" />
</selector>

android:drawable attribute does not accept raw color.

Define color.xml in res/values.

<?xml version="1.0" encoding="utf-8"?>
<resources>
     <color name="black">#000</color>
     <color name="white">#fff</color>
     <color name="grey">#cccccc</color>
</resources>


Android Listview RuntimeException - Your content must have a ListView whose id attribute is android.R.id.list

"Your content must have a listview whose id is android.r.id.list"

Just make sure your listview's id is @android:id/list.

<ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

Sunday, February 19, 2012

Blackberry Android Simulator Blinking Issue

Just submitted my first android port to Blackberry. In case you don't know, Blackberry Playbook OS 2 can run Android apps.

If you are using the simulator, you will notice whenever, you have an EditText, the whole screen will keep on blinking. After doing some research, I found the following:

http://twitter.com/#!/BlackBerryDev/status/169882992997711872

According to Blackberry, it seems like it's only the simulator that's doing that. I do not have an actual playbook, so I do not know if that's the case. So far, it took me half a day to convert my Android app to the Playbook.

The app I converted is the Ignite Study Flash Card.

PhoneGap and HTML5 - Ad CPM and CPC Calculator

Lately there are a lot of buzz about creating HTML5 PhoneGap applications on Android, iPhone, and Blackberry. I am not a big fan of writing HTML5 phone apps, since I think the HTML5 speed on the phone is still very laggy and slow.

If you have written any jquery mobile websites, you will probably see that the "apps" still feel like web pages whether than apps. It is very easy to tell whether an app is native or written in HTML5 on a phone. Feel free to comment below to let me know if you see any smooth HTML5 phone apps out there.

Anyways, I quickly wrote an app called Ad CPM and CPC Calculator. Below are the screen shots.




Description:


Ads CPM and CPC Calculator is the FIRST advertising calculator that lets you compute eCPC, eCPM, conversion rate, CTR, cost per conversion and campaign cost. You will never need to do tedious hand calculations again.

Ads CPM and CPC Calculator comes with three calculators:
Ad Rate Calculator lets you estimate the campaign cost by CPM and CPC.
Ad Inventory Calculator estimates impression and clicks given the budget.
Ad Spent Summary Calculator computes eCPC, eCPM, conversion rate, CTR, cost per conversion and campaign cost.


Android Market Link:

Download Ads CPM and CPC Calculator


Results:

I think the app is still quite laggy. It probably has to do with jquery mobile. Sometimes, the footer would bounce up or not refreshed probably. When switching through pages, it's not very responsive. You will have to click more than once on rare occasions.

I strongly recommend everyone to go native if possible. The only benefit for using HTML5 is it's fast and you can quickly launch to multiple platforms.

Sunday, January 15, 2012

IG Stock And Option Calculator For Android

Hi all, if you are a common stock trader using options to hedge your risk, you will find this tool useful. Whenever I purchase stocks, there are always a lot of calculations I compute to measure the risk.  I built this tool called IG Stock And Option Calculator to simply the whole tedious process.


Description:

IG Stock And Option Calculator includes 6 commonly used stock trading strategies for estimating risk.

Stock Return, Stop Loss, Long Call, Long Put, Covered Call, Protective Put.

Stock Return is for estimating or calculating your net profit from buying and selling a stock

Stop Loss calculates what prices you want to sell your stock at.

Long Call, Long Put, Cover Call, and Protective Put shows you the net profit and breakeven points.

Definitions:

A long call is simply the purchase of one call option.

A long put is simply the purchase of one put option.

A covered call is a financial market transaction in which holds a long position in an asset and writes (sells) call options on that same asset in an attempt to generate increased income from the asset.

A protective put is a risk-management strategy that investors can use to guard against the loss of unrealized gains. The put option acts like an insurance policy - it costs money, which reduces the investor's potential gains from owning the security, but it also reduces his risk of losing money if the security declines in value.


Product Features:
  •  Estimate stock return
  • Calculate sell price for stop loss order
  • Calculate break even price, net profit for long call
  • Calculate break even price, net profit for long put
  • Calculate break even price, net profit for long covered call
  • Calculate break even price, net profit for protective put
Screenshots:




Download Link:
IG Stock And Option Calculator