Thursday, May 8, 2014

Can't run native project on Galaxy Gear 2 ??

I just create and build a native project using Tizen SDK instead of SDK for Wearable since SDK for Wearable would not let me create a native Tizen project. However I can not launch the native App on Galaxy Gear 2 with the error message like this:
Cannot install application.

Error code: FATAL_ERROR
Error message: 
Command: /usr/bin/pkgcmd -q -i -t tpk -p /opt/usr/apps/tmp/Mf7csltynQ-1.0.0-arm.tpk
Management: Installation or uninstallation is not working temporarily.

So I searched for solutions on the internet. Unfortunately, all the people are saying Samsung doesn't support native project for Gear 2. 

http://developer.samsung.com/forum/board/thread/view.do?boardName=SDK&messageId=258302

https://developer.tizen.org/fr/forums/native-application-development/can-tizen-wearable-sdk-support-develop-native-app?langredirect=1

http://www.mautilus.com/tizen-and-qt/

Really don't understand why they release such a SDK only support Web project!!

Galaxy Gear 2 Start: sdb devices "No device listed"

When I first started prepare my development environment for Samsung Galaxy 2, a pretty trivial problem stops me. After I installed Tizen SDK and plugged my device to my laptop, I can not see it from "sdb devices". The result is just empty device list as below:
shuang@shuang-box:~$ sdb devices
List of devices attached
I keep searching the solution for this problem without result. There is a post on Tizen developer forum discussing the same problem: https://developer.tizen.org/forums/general-support/sdb-does-not-list-connected-test-device. But all the advice there have no effects for my case.

Then I realized it could be the setup on Galaxy Gear 2, so I press the system setup button and in the gear info sub-menu I found USB debugging  check box. There it is! I checked it and it works now.
shuang@shuang-box:~$ sdb devices
List of devices attached 
538131fd41001cb6 device SM-R380

Tuesday, April 15, 2014

Device name code in AOSP building system

Sometimes it's confusing trying to map the device name code to the corresponding hardware. I put the code and device name map here to make it easier to keep track of the supported hardware by Android.

ModuleCode
Nexus 5"hammerhead"
Nexus 7 [2013] (Wi-Fi)"flo"
Nexus 7 [2013] (Mobile)"deb"
Nexus 10"manta"
Nexus 4"mako"
Nexus 7 (Wi-Fi)"grouper"
Nexus 7 (Mobile)"tilapia"
Galaxy Nexus (GSM/HSPA+)"maguro"
Galaxy Nexus (Verizon)"toro"
Nexus S"crespo"
Nexus S 4G"crespo4g"
Motorola Xoom (US Wi-Fi)"wingray"

Apache2 + Tomcat 8 to host website

Just a memo for the steps I took to host my website on Amazon EC2 using tomcat 8 + apache2.

Install and config tomcat 

Put your website code to TOMCAT/webapps

Domain setup in tomcat

Edit TOMCAT/conf/server.xml, add a new host entry:

    
 
        www.rungist.com

        
        


Config proxy port in server.xml

   

Then restart tomcat

Install and config apache2

Use apt-get install apache2 to install the http server.
Config ProxyPass entry on /etc/apache2/httpd.conf
 
ProxyPass         /  http://rungist.com:8080/
ProxyPassReverse  /  http://rungist.com:8080/

Then restart apache2 service: sudo service apache2 restart

Refer:

https://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html

Monday, April 14, 2014

Remove ec2-user default privilege


  1. useradd to add a new user account
  2. Create password for the new user, add it to the sudoer list
  3. Enable PasswordAuthentication in /etc/ssh/sshd_conifg
  4. Change root password
  5. Lock ec2-user: passwd -l ec2-user
  6. Delete /etc/sudoers.d/xx
  7. Now the ec2-user has no root permission

Reference:
http://blog.braini.ac/?p=73

Ruby, Rails, RVM and me!

Thanks to Radar's blog about using RVM to install ruby instead of installing ruby as a package.

Following is the debug info for android-marketplace-crawler.
  1. Errors found in the Utils.java file when loading permissions.
     
    java.util.concurrent.ExecutionException: java.lang.ExceptionInInitializerError
        at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
        at java.util.concurrent.FutureTask.get(FutureTask.java:111)
        at com.marketplace.Main.execute(Unknown Source)
        at com.marketplace.Main.resolveArgs(Unknown Source)
        at com.marketplace.Main.main(Unknown Source)
    Caused by: java.lang.ExceptionInInitializerError
        at com.marketplace.io.Sender$AppQuery.toString(Unknown Source)
        at com.marketplace.io.Sender.appExists(Unknown Source)
        at com.marketplace.io.Sender.addAppToCollection(Unknown Source)
        at com.marketplace.service.CategoryThread.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at com.marketplace.Utils$Permission.<init>(Unknown Source)
        at com.marketplace.Utils.<clinit>(Unknown Source)
        ... 10 more
    
    This error is caused by the empty line at the end of the file "permission"
  2. This error came when create items in table
    undefined method 'class_inheritable_accessor'
    
    The error occurs because of the deprecated function in rails. Here is the solution to this problem: https://github.com/wvanbergen/request-log-analyzer/issues/103

My Linux Workstation Software List


Here is the list of OS that I have used and using:

  • Ubuntu 12.04
  • CentOS 5.6
  • Federo 14
This the list of software I use for daily work/study on these Linux system.

  1. Google Docs
  2. GIMP Image Editor
  3. Sublime Text http://www.sublimetext.com/2
  4. Vim Text Editor
Development Tool Kits:
  1. Eclipse Kepler + WTP + ADT
  2. GIT