2015年1月14日 星期三

WebView Size Problem in Andorid 4.4

1. the webpage will over screen size

ref :
https://developer.android.com/guide/webapps/migrating.html


add :
WebSettings settings = webView.getSettings();
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);





Other:
set webview background color

myWebView.setBackgroundResource(Color.TRANSPARENT);
myWebView.setBackgroundColor(Color.TRANSPARENT);

2015年1月7日 星期三

Disable TitleBar(ActionBar) in Android App

1. Activity shouldn't exntend ActionBarActivity

public class MainActivity extends ActionBarActivity {

public class MainActivity extends Activity {


2. in AndroidManifest.xml

            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

Android WebView App Crash on Android 4.4 in GenyMotion

In LogCat

Some errors like

eglCodecCommon﹕ **** ERROR unknown type  (many)
GL ERROR :GL_INVALID_ENUM : glProduceTextureCHROMIUM: target was GL_TEXTURE_EXTERNAL_OES


temporary disable hardware accelerate

in AndroidManifest.xml

.
.
android:hardwareAccelerated="false"
.
.>


reference :
http://stackoverflow.com/questions/26836858/android-genymotion-vm-logcat-runs-into-infinite-loop



http://blog.csdn.net/lfdfhl/article/details/9139259

2014年10月17日 星期五

CentOS SELinux http bind port (http listen port other than (80, 81, 443, 488, 8008, 8009, 8443, 9000)

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.html



1. List current allowed port

semanage port -l | grep -w http_port_t

http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000


2. Add another port

semanage port -a -t http_port_t -p tcp 12345


2014年9月30日 星期二

Android In App Billing Note


The Item that you were attempting to purchase could not be found, while download app from google play

1. check if the apk is uploaded and published aka 已發布 (even in Alpha stage)
    in Developer Console, the Apk , right up corner
2. check the SKU name
3. IAB need to test in REAL device (not virutal device like AVD)
4. the google account of the test device can not same as the Developer Console's account
5. the test apk should use same version number and same key to signed as the uploaded apk


Android Developer Tools 23.0 Export APK Error



When Exporting APK, there are 3 kinds of error when using ADT 23.0


1. duplicate id @+id/image already defined earlier in this layout

2. This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView) : google-play-services_lib

3. "app_name" is not translated in af, am, ar, be, bg, ca, cs, da, de, el, en-rGB, en-rIN, es, es-rUS, et, et-rEE, fa, fi, fr, fr-rCA, hi, hr, hu, hy-rAM, in, it, iw, ja, ka-rGE, km-rKH, ko, lo-rLA, lt, lv, mn-rMN, ms, ms-rMY, nb, nl, pl, pt, pt-rBR, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rCN, zh-rHK, zh-rTW, zu

to fix that  Change Lint  FATAL to Warring
Window -> Preference -> Android -> Lint Error Checking

Correctness ->  DuplicateIds
Correctness ->  Instantiatable

Correctness:Messages -> Missing Translation

2014年9月24日 星期三

Laravel Installation in CentOS

1. Installl Composer Globally


https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer


2. Install Laravel


* Required PHP 5.4
For upgrade PHP 5.3 to PHP 5.4

composer global require "laravel/installer=~1.1"


3. add ~/.composer/vendor/bin into $PATH



4. create a new laravel project which name is "test" in /var/www/html


cd /var/www/html
laravel new test


5. give  test/app/storage   write permission to apache




6. add a virtual host in httpd.conf

 
    ServerAdmin webmaster@example.com
    DocumentRoot /var/www/html/test/public
    ServerName laravel.example.com
    ErrorLog logs/laravel-error_log
    CustomLog logs/laravel-access_log common
           
                AllowOverride All
           




 7. browse  http://localhost/


It should display "You have arrived."


8. edit config files

app/config/app.php
'debug' => true,   //for debug message
'timezone' => 'Asia/Taipei',  //for timezone to Taipei

app/config/database.php


9. add a sample router

edit   app/router.php

Route::get('time', function()
{
    return date("Y-m-d H:i:s");
});

browse http://localhost/time