跳到主要內容

AndroidManifest的小技巧

當在設定推播時,在 AndroidManifest.xml 上需要指定不同application id時該怎麼辦呢?(可能會有xxx.yyy.com.debug與xxx.yyy.com兩個版本)
有個簡單的小技巧可以實現這件事情。
<permission android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />

參考資料:Using build types in Gradle to run same app that uses ContentProvider on one device

留言

這個網誌中的熱門文章

input 陣列 - PHP

要如何在 input 裡面回傳陣列資料呢? 就寫了一個簡單的小範例。 以下是 php 原始碼 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <?php /** 印出Get裡面的資訊 **/ if ( ! empty ( $_GET )) print_r ( $_GET ); /** 初始資料設定 **/ $id = array ( 0 => '#0001' , 1 => '#0002' ); $data [ $id [ 0 ]] = array ( 'date' => '2012-08-12' , 'note' => '上海出差' ); $data [ $id [ 1 ]] = array ( 'date' => '2012-08-17' , 'note' => '北京出差' ); /** 印出表單資訊 **/ echo "<form method='get'>" ; foreach ( $data as $key => $row ){ echo "<input type='text' name=' { $key } [date]' value=' { $row [ 'date' ] } ' />" ; echo "<input type='text' name=' { $key } [note]' value=' { $row [ 'note' ] } ' />" ; echo "<br />" ; } echo "<input type='submit' value='送出' />" ; e...