目前日期文章:201707 (5)

瀏覽方式: 標題列表 簡短摘要

 

我們可以開啟混淆用來混淆生成的java code防止他人反編譯你的程式碼

自動刪除沒有Resources文件 來達到給APK瘦身的目的

文章標籤

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()

1.Declare intent name in Manifest file:

<action android:name="com.yourdomain.youapp.SETTING_UPDATE" />

2.Define intent name:

文章標籤

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()

  //1 minute = 60 seconds
    //1 hour = 60 x 60 = 3600
    //1 day = 3600 x 24 = 86400
    public void printDifference(Date startDate, Date endDate){

        //milliseconds
        long different = endDate.getTime() - startDate.getTime();

        System.out.println("startDate : " + startDate);
        System.out.println("endDate : "+ endDate);
        System.out.println("different : " + different);

        long secondsInMilli = 1000;
        long minutesInMilli = secondsInMilli * 60;
        long hoursInMilli = minutesInMilli * 60;
        long daysInMilli = hoursInMilli * 24;

        long elapsedDays = different / daysInMilli;
        different = different % daysInMilli;

        long elapsedHours = different / hoursInMilli;
        different = different % hoursInMilli;

        long elapsedMinutes = different / minutesInMilli;
        different = different % minutesInMilli;

        long elapsedSeconds = different / secondsInMilli;

        System.out.printf(
            "%d days, %d hours, %d minutes, %d seconds%n", 
            elapsedDays,
            elapsedHours, elapsedMinutes, elapsedSeconds);

    }

out put is :

startDate : Thu Oct 10 11:30:10 SGT 2013
endDate : Sun Oct 13 20:35:55 SGT 2013
different : 291945000
3 days, 9 hours, 5 minutes, 45 seconds

文章標籤

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()

List<MarkerCustom> myList=new ArrayList<MarkerCustom>();
MarkerCustom entry1=new MarkerCustom(myInt, myString, myBitmap);
MarkerCustom entry2=new MarkerCustom(myInt, myString, myBitmap);

myList.add(entry1);
myList.add(entry2);

文章標籤

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()

 TextView TV = (TextView)findViewById(R.id.mytextview01);
 Spannable word = new SpannableString("Your message");        

 word.setSpan(new ForegroundColorSpan(Color.BLUE), 0, word.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

 TV.setText(word);
 Spannable wordTwo = new SpannableString("Your new message");        

 wordTwo.setSpan(new ForegroundColorSpan(Color.RED), 0, wordTwo.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
 TV.append(wordTwo);

 

BackgroundColorSpan => For background color!

文章標籤

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()

找更多相關文章與討論