Android開發人員著作權時間限制 定時在哪段時間可以用。

來源:互聯網
上載者:User

標籤:android   源碼   c語言   apk   軟體   

有開發時,有時只想讓使用者只能用程式一天,或一個月,或更長時間。


void limited() {

Time t = new Time(); // or Time t=new Time("GMT+8"); 加上Time Zone資料。
t.setToNow(); // 取得系統時間。


String time = t.year + "年 " + (t.month + 1) + "月 " + t.monthDay + "日 "
+ t.hour + "h " + t.minute + "m " + t.second;
Log.e("msg", time);
//if (t.year == 2014 && t.month + 1 == 9 && t.monthDay == 23) 測試
if(t.year!=2014 || (t.month+1)!=9)//這個月
// if(t.year!=2014 || (t.month+1)!=9||t.monthDay!=23) //今天
{
Toast.makeText(MainActivity.this,"調用版時間到自動結束,請聯絡軟體作者QQ:345139427" ,
Toast.LENGTH_LONG).show();
 
new Handler().postDelayed(new Runnable(){   //順延強制
@Override
public void run(){
android.os.Process
.killProcess(android.os.Process
.myPid()); // 終止線程
}
}, 3000);
}
}

Android開發人員著作權時間限制 定時在哪段時間可以用。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.