2015年8月30日 星期日

Xamarin Android App 1

Ref: https://www.visualstudio.com/en-us/features/xamarin-vs.aspx
ASUS X450J / Windows 10 x64 Education
ASUS Zenfone 6
1. Download xamarin installation from vs 2015.
2. The installation was stopped during the slowly download rate.
3. Download XamarinStudio and XamarinVisualStudio manually.
4. Install XamarinStudio and XamarinVisualStudio.
5. Install Xamarin intsllation again.
6. VS2015 new Android project
7. Change to release mode




2015年8月21日 星期五

Android push Server test

Ref:https://developers.google.com/cloud-messaging/android/start?configured
1. First try
ASUS X450J Windows 10 + Android 1.2/1.3
Download Gradle for windows, fail to send message to GCM
2. Macbook Pro  OX 10.10.5 + Android 1.3
    ASUS zenfone 5 and 6
3. Both of zenfone 5 and 6
4. Download android examples
    https://github.com/googlesamples/google-services
5. Download google-Services.json


6. Copy to gcm/app folder
7. Replace API into Gcmsender.java
8. Install Quickstart sample into zenfone 5 and 6
9. ./gradlew run -Pargs="<message>"
  Automatically download and install package



10. ./graglew run -Pargs="推播中文Zenfone 5 and 6"
11. Response
12. Windows 


2015年8月18日 星期二

主控台程式,中英文模式切換

1. ASUS X450J/ Windows 10 Education version
2. Add Ref : https://inputsimulator.codeplex.com/

namespace ConsoleApplication1
{
    using WindowsInput;
    using WindowsInput.Native;
    class Program
    {
        static void Main(string[] args)
        {
            InputSimulator im = new InputSimulator();
            System.Threading.Thread.Sleep(1000);
            im.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.SPACE);
            Console.Write("輸入英文:");
            Console.ReadLine();
            System.Threading.Thread.Sleep(1000);
            im.Keyboard.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.SPACE);
            Console.Write("輸入中文:");
            Console.ReadLine();
        }
    }
}

2015年8月6日 星期四

簽署時發生錯誤: 找不到 SignTool.exe

Ref: http://stackoverflow.com/questions/22946399/signtool-error-no-certificates-were-found-that-met-all-given-criteria-with-a-wi
1. Windows 10 Education version
2. VS 2015 Dreamspark
3.  Download KTOI source code(https://ktoi.codeplex.com/)
4. Test run error : 簽署時發生錯誤: 找不到 SignTool.exe
5. Go to property of project
6. De-select 簽署簽證清單...

2015年7月5日 星期日

Android Studio 使用 Samsung 手機

Ref: http://stackoverflow.com/questions/28056544/samsung-galaxy-phone-is-not-recognized-on-android-studio
1. System: Windows 10 + Android Studio 1.2
2. Mobile : Samsung Galaxy Grand 2

Samsung 手機需使用專用 USB 驅動程式,否則Android Studio無法偵測到手機,就無法上傳app,需要由檔案總管,將*.apk複製到手機安裝。
Samsung USB 驅動程式 下載後,請勿連接手機安裝,俟完成後,再連接Samsung手機,Android Studio 可以找到手機,直接上載apk程式進行測試。

2015年6月15日 星期一

android:layout_below

Force the control located below another control as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    
                xmlns:tools="http://schemas.android.com/tools"    
                android:layout_width="fill_parent"    
                android:layout_height="fill_parent"    
                android:orientation="vertical" >
    <Button android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/button1" />
    <Button android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           android:layout_below="@id/button1"
           android:text="@string/button2" />
    <TextView android:id="@+id/textView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
             android:layout_below="@id/button2"/>

</RelativeLayout>

android studio rendering problems

Ref; http://stackoverflow.com/questions/18195807/android-studio-rendering-problems
The default version is API 22 (5.1.1)
Change to API 19 (4.4.1)
OK。