Wednesday, April 8, 2015

Android - How to browse Android Emulator SQLite Database


In this tutorial, we will show you how to browse android emulator SQLite database.
You need these tools! Trust me, if you not able to browse data that you have saved you will spend a lot of time and killing your brain cell to debug line by line. That is a nightmare :).

How to browse Android Emulator SQLite Database

There are 2 ways to browse SQLite database in Android Emulator
  • View from the eclipse with a plugin tool.
  • Pull data out from eclipse and view data with SQLite database Browser, (There are some other tools also can view the database like SQLiteSpy.)

  • View from the eclipse with a plugin tool
  1. Download com.questiod.sqlitemanager.jar and save into “X:\…\eclipse\dropins” folder, Eclipse update manager will install any jar in this directory, if you like to uninstall it just simply delete the jar file.
  2. Restart Eclipse.
  3. Navigate menu to Windows>Show View>Other>Questiod SQLite Manager
    Show View
  4. Find the DDMS icon, and click on it. The SQLite manager tools should be installed and it will look like below
    SQLitemanager
  5. So, Let’s try it!
  6. In this tutorial,
    We will use com.android.providers.email database that available in the emulator as testing target and it’s locate in data/data/com.android.providers.email/databases/EmailProvider.db. Click on the File Explorer. You should see something like this. Please take note you need a “db” extension file or else the tool will not enabled.
    File Explorer
  7. Click on the Open File in SQLite Manager… icon
  8. You will see the image like below for viewing all tables and data.
    Browse android emulator database
  9. Click on the Browse Data tabs, and choose a table named android_metadata, you will see data in this table.

  • Pull data out from eclipse and view it with SQLite database Browser.
  1. Click on DDMS icon. Icon in the highlight circle is for import file from and to emulator, the left icon is export and right icon is for export. Click on the left icon to save it to the desktop.
    Pull data
  2. In case you can’t see DDMS as showed in image. You can bring it out by going to Window > Open Perspective > DDMS
  3. Use SQLite Browser, Click Open Existing Database file and then select EmailProvider.db from where you save in step 1.
  4. And you will see image like below. This tool allow you to insert, update data and write query in Execute SQL tab.
    Pull data

Tips:
1. When you create your database, please make sure create with “db” extension. i.e. instinctcoder.db.
2. Personally i preffered the 2nd method as it allow you to insert, update data and select data.
3. During development, sometimes you need to run in debug mode(F11) in order to get latest data.

Source:  http://instinctcoder.com/how-to-browse-android-emulator-sqlite-database/

Tuesday, April 7, 2015

Monday, April 6, 2015

Joomla - Virtuemart - Đổi định dạng tiền tệ VND

Change currency format in Virtuemart, Joomla

Virtuemart > Currency
Currency: chọn VietNam Dong
Currency symbol: VNĐ (Cái này là do mình tự ghi, nếu ko thích để VNĐ phía sau giá tiền thì bạn để trống)
Decimals: 0 (Số không nhé)
Decimal symbol: . (Dấu chấm)
Thousands separator: . (Dấu chấm)

[Positive format: chọn 00 Symb
Negative format: chọn -00 Symb]

Saturday, April 4, 2015

Tomcat - startup Error - is not deploying web project in Eclipse

"The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the ...."


Let's try the following solutions:

1. Define JAVE_HOME, JRE_HOME first

2. Add a system property to the launch configuration of the tomcat server in eclipse.

3. Download and place tcnative-1.dll 64/32 bit in bin folder.

4. change the eclipse tomcat server configuration. Open the server view, double click on you server to open server configuration. Then click to activate "Publish module contents to separate XML files". Finally, restart your server, the message must disappear.

enter image description here

5. look into .setting\org.eclipse.wst.common.component file in your web project in eclipse.
< wb-module deploy-name="PROJECT_NAME">
check the PROJECT_NAME. It might got messed up. Similarly look into .project file.