2013年2月22日 星期五

The Customized Android Activity on Unity3D

   The Unity3D is not accept you to change the launch flow.but some time we need to insert the special flowchart( for example : login, play the opening video, native menu...etc). So it's not a function in current version(4.5.6). but we still can finish it.

In Android, we can insert the special Activity to be launch point. and launch the Unity activity later. the principle is that, when you put the Manifest in project folder(Assets/Plugin/Android/), the release will use it. you should put res/ and assets/ too. finally the src/ should compile to jar file, and put it in bin/.

//TODO add source code

The iOS solution will discuss later.

Reference : 

http://lancelotdiary.blogspot.tw/2012/05/unity3d-plug-in-for-android-activity.html
http://randomactsofdev.wordpress.com/2011/08/19/accessing-the-android-compass-through-unity-3d/


2013年2月19日 星期二

Data Mining for Social Media : Hurricane Sandy Tweetbeat

   Some guy use data mining for social media when the Hurricane Sandy is comed. it's call Hurricane Sandy Tweetbeat.




   It's my favor to analysis the data in social media. and try to find out the story behind the data. we build a project(call refresh bpm) to found out the definition for any kind of emotions in the world.

2013年2月16日 星期六

Httpd on a App(Android and iOS)

    We found a lot of app contain http/ftp(the ftp protocol is not discuss today) server to upload file/video/music(like GPlayer). that's let me interest how to implement it on a app. according to my survey, if you want to do it on Android. you can use NanoHttp(implement by java.net.ServerSocket). on the iOS, you can use CocoaHTTPServer(implement by sys/socket). Btw those lib is not make sure fully support HTTP spec.

picture: the screenshot of upload page of GPlayer (support drop-n-upload feature!)


Reference: 
http://stackoverflow.com/questions/6804650/ios-devices-as-web-server

2013年2月14日 星期四

The Shiro and Quartz2 Plugin's Confliction

We always install Shiro(for security feature) and Quartz2(for offline worker) plugins when we develop Grails Application.

but the Shiro plugin contains Quartz-1.x jar, so we can not run application by command run-app. 

Solution: download the newest quartz jar from official site, and put it into /lib/

the problem still occur when deploy the war file on the web container(for example : tomcat)

Solution: remove the useless jar file in the war at the last step of build war file

add some code at /grails-app/conf/BuildConfig.groovy

//TODO add the source code in here

finally we can work perfectly. but it's show some problem for java dependency manager(the grails use ivy by default), it can not handle the dependency perfectly between each plugin.


2013年2月5日 星期二

Pull Down to Refresh UI Design

   The action of pull down and refresh is normal feature in mobile app. but the official SDK isn't support it. so we find some  open source  :


i use the Android-PullToRefresh. because it support :
  • ListView
  • ExpandableListView
  • GridView
  • WebView
  • ScrollView
  • HorizontalScrollView
  • ViewPager

we just replace my GridView into PullToRefreshGridView, and setOnRefreshListener().

public static interface OnRefreshListener<V extends View>{
    public void onRefresh(final PullToRefreshBase<V> refreshView);
}

Remember, you should call onRefreshComplete() let the UI stop the animation.