2017年6月15日 星期四

Android 在別的畫面(app) 去呼叫特定已開啟的App

AndroidMainfest.xml
-------------------
<activity    android:name=".main.Activity1"   
 android:configChanges="keyboard|keyboardHidden|orientation"
 android:label="@string/app_name"   
 android:screenOrientation="portrait"
  android:launchMode="singleInstance" <= 此行絕對不能加,會造成呼叫其他的app
> <!-- Prevents authorization dialog from closing when screen orientation is changed -->
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>


-------------------
可用BroadcastReceiver來收到廣播,再行處理,此方法每次呼叫 不會onCreate其activity

Intent intent = new Intent();
intent.setComponent(new ComponentName("com.captain.voice.alexa.mobile", 
"com.captain.voice.alexa.mobile.main.Audio_Record"));
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

網頁動畫效果

1.斜角度移動:
<div  id="move_bar2"  style="position:absolute;z-index:1;left:290px;top:240px">
<img  src="images/n/demo/mask1_back.jpg"  style="width:40%;"/>
</div>
---------------------------------

 $("#move_bar2").animate({left: "-=110",top: "+=60" }, 500);

2017年6月8日 星期四

OKHTTP 重要教學

1.同步與非同步傳輸模式
https://github.com/square/okhttp/wiki/Recipes

非同步(asy) 可以捕捉request失敗的狀況,再重傳.


2,Application與Network 的Response監聽方式
https://github.com/square/okhttp/wiki/Interceptors

Application較為正常

2017年5月8日 星期一

Android UI 畫面 處理

1.其他類別 去 更新本體Activity的UI:
    new Thread(new Runnable() {
    public void run() {
       
        ((Activity) Audio_Record.con).runOnUiThread(new Runnable() {
            public void run() {
         
                Audio_Record.gifImageView.setGifImageResource(R.drawable.speaking);

            }
        });
    }
}).start();

2017年5月5日 星期五

Android 動畫

1.GIF動畫:
  如果使用View 來產生去讀取XXX.gif動畫,則在AndroidManifest.xml中加入android:hardwareAccelerated="false"


<activity android:name=".XXXActivity"  android:hardwareAccelerated="false"></activity>

2017年5月3日 星期三

執行 SSE4.1 遊戲

http://game.ali213.net/thread-6215367-1-1.html

1:SDE文件夾 放在D盤
2:打開管理員 檢視 選取
3:PID(程序識別碼)勾起 確定
4:啟動遊戲之後.管理員(處理程序)找到遊戲的PID數字
5:然後打開windows的CMD 輸入D: 按下回車
然後輸入cd sde 按下回車
然後輸入sde.exe -attach-pid XXXX按下回車 (XXXX就是PID的數字)
(提示)每次重新進入遊戲PID都會不一樣的數字!!
(最後回到遊戲.載入進入遊戲)
(請先下载SDE解壓)
http://pan.baidu.com/s/1hs3H2SG