Giter VIP home page Giter VIP logo

ntp-sync's Introduction

NTPSync

NTPSync is a simple NTP time synchronization app for Android.

For more information visit http://code.google.com/p/ntp-sync/

Build with Gradle

  1. Have Android SDK "tools", "platform-tools", and "build-tools" directories in your PATH (http://developer.android.com/sdk/index.html)
  2. Export ANDROID_HOME pointing to your Android SDK
  3. Install gradle
  4. Execute gradle wrapper (http://www.gradle.org/docs/current/userguide/gradle_wrapper.html)
  5. Execute ./gradlew assemble

More build information

Two productFlavors are build with gradle. One for Google Play (without Paypal and Flattr Donations) and one for F-Droid (without Google Play Donations).

Contribute

Fork NTPSync and do a Pull Request. I will merge your changes back into the main project.

Libraries

All JAR-Libraries are provided in this repository under "app/libs", all Android Library projects are under "libraries".

Build Apache Commons Net

  1. Download Source zip file from http://commons.apache.org/net/download_net.cgi
  2. Strip it down to NTP only:
  • remove src/test
  • remove src/main/java/examples
  • in src/main/java/org/apache/commons/net remove every folder except io, util, ntp
  1. execute mvn package to build jar in target directory

Use NTPSync in your Android application

You want to query NTP servers from your Android app or set the system clock to NTP time?

This can be done very easy using interprocess communication (IPC) in Android with AIDL. NTPSync provides you with an Interface where your application can connect to.

See https://github.com/dschuermann/ntp-sync/tree/master/API-Demo for a complete example.

  • You need the following permissions in your Android Manifest, adapted to your needs:
<uses-permission android:name="org.ntpsync.permission.GET_TIME" />
<uses-permission android:name="org.ntpsync.permission.SET_TIME" />

Translations

Translations are hosted on Transifex, which is configured by ".tx/config"

  1. To pull newest translations install transifex client (e.g. apt-get install transifex-client)
  2. Config Transifex client with "~/.transifexrc"
  3. Go into root folder of git repo
  4. execute tx pull (tx pull -a to get all languages)

see http://help.transifex.net/features/client/index.html#user-client

Coding Style

Code

  • Indentation: 4 spaces, no tabs
  • Maximum line width for code and comments: 100
  • Opening braces don't go on their own line
  • Field names: Non-public, non-static fields start with m.
  • Acronyms are words: Treat acronyms as words in names, yielding !XmlHttpRequest, getUrl(), etc.

See http://source.android.com/source/code-style.html

XML

  • XML Maximum line width 999
  • XML: Split multiple attributes each on a new line (Eclipse: Properties -> XML -> XML Files -> Editor)
  • XML: Indent using spaces with Indention size 4 (Eclipse: Properties -> XML -> XML Files -> Editor)

See http://www.androidpolice.com/2009/11/04/auto-formatting-android-xml-files-with-eclipse/

Licenses

NTPSync is licensed under the GPLv3+.
The file COPYING includes the full license text.

Details

NTPSync is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

NTPSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with NTPSync. If not, see http://www.gnu.org/licenses/.

Libraries

Images

ntp-sync's People

Contributors

intrications avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.