I am trying to get time from an Internet Time Server. And I found that android.net.SntpClient is a good solution that I could use.
But my Android SDK (Android API 19) does not contain that class. I downloaded the "Sources for Android SDK" via SDK Manager and the source code contains the SntpClient.java (source file for class android.net.SntpClient)
Please view the images links I uploaded. (sorry, I dont have enough reputation for images right here)
The android SDK:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/1888504_897281990284152_2310291065247680835_n.jpg?oh=989c5f49848a8914d77bb0d4aac8897d&oe=54F8E9D6
The sources:
https://scontent-a-sea.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/10659310_897281993617485_1823842706987095742_n.jpg?oh=27ee6a075967731dc7265352c22002cd&oe=54DCBB73
Could anyone tell me why this file is not compiled? If I want to use this class, I have to explain to my boss why android SDK doesn't contain it.
Thanks a lot
Google has chosen not to make all public classes available as part of the SDK. Visibility is controlled by the #hide comment tag as described here.
I'm not sure why they chose to hide SntpClient particularly, but provided you respect the terms of the Apache license you can copy the source into your application without much modification.
Related
A DVR I bought includes its SDK which gives me all the programming codes for the DVR.
The example I found in the SDK was made for Windows only, is there a way I can implement these methods on Android using NDK?
The SDK uses .cpp files and some .h files. It also links to an external .dll file which I have no way of reading the codes to implement to Android
EDIT
I'm trying to implement these methods for a live view application. I managed to get the stream using rtsp with low latency using a different source, but I need to get the playback function which is available in the SDK
EDIT 2
What I mean by "playback" is to play the recorded videos saved on the hard disk of the DVR.
I asked some of my connections and they confused "playback" with "livestream" so this might also confuse some who reads this question
I decided to add a App Widget to my application , I follow this guide on official Android developer page (link). Done everything what they have there and still I get this error:
I have my app-widget provider in /res/xml. Having widget layout in /layout folder and having AppWidgetProvider.java in Java folder.
So everything should be fine. Also I am using latest Android Studio with latest SDK (23) and latest build tools (23.0.2) and also using appcompat-v7 suppport library.
I pasted code from the page, just to be sure everything is in order. Seems like it's not.
I am frustrated after several hours of trying everything. My appplication is long term project, I am almost at the code version 200, so I have some experience, but not with this. I also read almost the whole thing.
PS: Any code would be useless to post in here, since it's the same code from that official Android Developer page. I wanted to do "prototype", which I can then customize to my needs. I never worked with widgets.
I am new to android and java development although I am an expert with IPTV and I have made the biggest Greek and Cyprus IPTV but since there is a lack of Greek IPTV android apps I decided to make one application.I found IPTVCore on playstore which is made by the developer of the IPTV app.In the description it has a link on an app that uses iptv core github
I downloaded the zip changed the icons and renamed the files. In MainActivity.java I removed the first comments and added my playlist url and changed package name.
I have android studio and eclipse with android addons.
How to make it an apk?
If you mean to simply be able to load it onto a devices to test then both Eclipse and Studio will allow you do this when you elect 'Run' and have a device attached via the USB (with USB debugging enabled). This will actually install the apk on your device so you can test it.
If you mean actually making the apk available for others (via the play store for example) then you should look and the Android publishing documentation:
http://developer.android.com/tools/publishing/publishing_overview.html
In very broad terms, you develop the app, build it, test it etc and then when it is ready for release you build it for release (remove all debug code, test data etc), sign the app, and release it via a marketplace like Play Store, or avi email or your own web site.
One important thing to remember is to version the app properly - the is important for all the obvious reasons (users or support wanting to know the version) but also because the marketplace update mechanisms may use it to check what versions can be updated etc.
Update - answering the question in the comment below:
There are two approaches suggested in the Readme file with the project:
To build you custom IPTV app you can do one of the following:
Clone iptv.example project, change app name, launcher icon, and
package name.
Blockquote
Create new Android project with empty activity and use
the code from MainActivity.java
The second one might actually be simpler for you if you know how to create a simple Android project - just do that and then replace the MainActivity code in the newly created project with the code in the MainActivity file (the only java source file) in the githib project you have downloaded.
Where does the OS saves the screenshots it takes of the recent apps? I have searched for the finding the directory location but couldn't find any info. I have also looked through Android source code and found that Google is calling toggleRecentApps() using handler but couldn't reverse engineer the code further.
Does anybody knows the location/directory of the screenshots of Recent apps?
Regards
I am really sorry to ask such a bland and stupid question, but I am having the greatest of frustrations with trying to load the Google Maps project library into my project resources.
I have downloaded all the tools and necessities needed from the SDK to get Google Maps.
However, whenever I try to load the Google Maps library, I get 2 errors.
The first is that for some reason,
the Class known as FragmentActivity is missing. I have no idea what
it is or where to find it to get things going with an Android project.
The second distinct problem is that the console shoots off the following message:
"google_maps] Unable to resolve target 'android-16'"
Although I have a fairly strong idea of what this means, I don't quite know how to troubleshoot so that the library is built towards the desired API level.
I do apologize as I am new to Android and absolutely love the platform, but this one really has me dumbfounded. Any and all information and suggestions is always most appreciated.
Thanks and once again, sorry for asking something so silly.
Well for the first question:
FragmentActivity is part of the google-support-v4 library and designed for application that are developed to SDK < 11 for supporting fragments. So you didn't added the referencing of this library to you project.
you can get a better idea of the imports you need to make and how to make them by reading this
blog post I wrote on Google Map API V2:
Google Map API V2 guide
about your second question, you probably trying to run this project against an API level you didn't downloaded from the SDK Manager, you have two options:
downloaded the needed API package from the SDK Manager.
right click on your project -> Properties -> Android -> change the project build target to a target that you have its API level downloaded.
Try this answer, Generate Google Map key for android - step by step.
Or take a look to this very helpful step by step tutorial. I struggle for 3 days with the maps stuff, but that tutorial showed me the light.