获取Android设备上当前时间 [英] Get current time on Android device

查看:226
本文介绍了获取Android设备上当前时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建立在我的统一的Andr​​oid应用程序,它可以让用户选择一个时间的东西,然后把它们发送那时如果他们不使用的应用程序后,每半小时的通知和

我有Android原生插件( HTTPS://www.assetstore。 unity3d.com/en/#!/content/10825 )安装在照顾本地通知,但不知道如何在一个特定的时间发送本地通知。我如何获得设备上的当前时间?有没有办法做到这一点在Unity?


解决方案

  System.currentMilleseconds();

将reruen milleseconds自1970年以来...您可以使用

 日历C = Calender.getInstance();
 c.getItem(Calender.DayInMonth)

...唧唧歪歪

I want to set up something in my Unity Android application that let's the user pick a time and then sends them a notification at that time and every half hour after if they don't use the app.

I have the Android Native plugin (https://www.assetstore.unity3d.com/en/#!/content/10825) installed that takes care of local notifications but don't know how to send local notifications at a specific time. How do I get the current time on the device? Is there a way to do that in Unity?

解决方案

 System.currentMilleseconds(); 

will reruen milleseconds since 1970... you can use

Calender c = Calender.getInstance();
 c.getItem(Calender.DayInMonth)

... BLA BLA BLA

这篇关于获取Android设备上当前时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆