Where could I find the useable-native-apis when coding NativeScript App? - javascript

The article accessing-native-apis-with-javascript tells us how to use naive-Apis with js code. It is good.
But, I don't know where is the native-Apis because I never come into Android. Is it a necessary to know basic of Android knowledges for all Nativescript learner?
So I turned to Android developer site to find the list, and I falled in an other rabbit hole. It is so complicate to me.
Can you give us a usable-native-Apis-list to access the native-Apis easily?
For example, I want to use device's contacts in my App, so I turn to Android-developer-guide site to find which API is the right one. I get a lot of APIs named "contact****", which one is the target? It's painful to seek the answer for a learner of Nativescript.
"The beauty of Nativescript is .....", I turn to Nativescript just because of these words.
But, if I should learn about all the native APIs to see the beauty in the end?

when you need to use native api , you can search for that , and you will find java code for that for example https://stackoverflow.com/a/12562234/4146943
In this answer you need getContentResolver then you search in android docs to get the package name of getContentResolver https://developer.android.com/reference/android/content/Context.html#getContentResolver()
In the begin of page you see android.content.Context so you can use android.content.Context.getContentResolver
Note :
knowing java and a little android develope with java wold really help.
Note2 : checking other plugins to see how others use native api really helps.

Related

Is it possible to expose the api endpoints from a C# sdk in order to use Javascript?

I want to expose the canon camera SDK to use it with Javascript. I don't know C# (I know someone will say to just learn it...). But really just wondering if this is even possible? The SDK only allows C, C++, C#, Objective-C, and Swift. So I guess any of those would work.
I figured the StackOverflow gods would have a definite answer.
Even though I wasn't able to use the SDK, I did find exactly what I wanted in the comment posted by #Lk77
I wanted to be able to make a UI for camera controls remotely and I thought that was only possible using the cannon sdk but actually, cannon provides an exposed interface to use when you enable the CCAPI on the camera itself. And that repo had a pretty good example. Thanks for all the help everyone.

Creating a printable/downloadable PDF of a web application

I have been searching for an answer to this problem now for several weeks. I also previously tried to research this a few years ago to no avail.
Problem Summary:
My company has developed a web-based data analytics suite for a major beverage distributor. They have recently asked for a feature that allows the user to print or download a visually pleasing version of the rendered app as a PDF. I have had no luck in finding a solid, controllable, or reliable method to do this. I was hoping the stack community might be able to point me in the right direction.
Current Tech Stack:
Plack servers
Perl base on the Dancer framework
Standard web dev front-ends: HTML5, CSS3, Javascript, Jquery/UI
Client is using IE9/10 and Chrome.
Attempted Solutions Summary:
Obviously I started with the window.print() and tried to control what printed using classes and a specialized print.css but the output was still awful.
I looked in to pdfmachine and pdfbox and even contacted Adobe's acrobat development team directly to see if they had an out of the box solution our company could purchase. I was informed that such a product would be counter intuitive to their desired business model of putting an acrobat subscription on each client computer rather than a single server side application.
I have extensively searched the stack articles but did not feel that the articles I found covered what I was looking for.
At present, I am all out of ideas and am hoping somebody out there has had better luck at this than I have.
tl;dr = I need a pdf version of the rendered output of a complex reporting app.
Thanks for your time stack, I appreciate it.
A solution I have used in the past is to use PhantomJS running on a server to generate the PDF for download/email. Usually if the content is sensitive the server (that handles authentication) would provide a single use viewing token that is then passed to a PhantomJS process. It loads the URL with the viewing token then saves as a PDF.
Further info on Phantoms screen cap API can be found here on GitHub.
https://github.com/ariya/phantomjs/wiki/Screen-Capture
Is it something you can create in Perl using PDF::API2 or PDF::Create? You can load and modify and existing PDF (handy if you want standard headers and footers), and then insert the relevant content. The learning curve can be a bit steep, but simple reports should be easy enough.
See PDF::TextBlock and PDF::Table too - they are great little helpers.
Consider this service http://pdfmyurl.com/ . I try to use many perl modules, but they dont satisfy my problems.

How to start with phonegap development?

Hi I have gone throught the site: phonegap
I have also read the documentation provided there, but is there any easy way tutorial available for that?
I have less idea about javascript coding and what I found is phonegap is entirely based on javascript. Can anyone guide me from where to start with?
Thanks in advance.
Mrunal
http://docs.phonegap.com/ : This will give you the insight of
PhoneGap APIs with source:
http://drupal.org/project/phonegap : Here you will get the complete
source code of Drupal PhoneGap app which runs of Android. iPhone and
BlackBerry. This source will help you to understand the PhoneGap
development techniques
they do have detailed set-up instructions and gettin started help.
You don't need JavaScript for a basic Phonegap App. What they do is basically translate a WebPage to a App for the desired Plattform. Therefore you just need to know as much Javascript as your app needs.
Afaik you can also use frameworks like jQuery.
More tutorials are available here: http://wiki.phonegap.com/w/page/35501397/Tutorials
Here on UI Development: http://wiki.phonegap.com/w/page/36767911/UI%20Development%20on%20PhoneGap
And there is many more.
Maybe you can look into general Javascript tutorials first if you look for a special effect or so.
Amazon has more books on PhoneGap that offers basic tutorials and code walkthroughs. Here is a new book with sample code available for download.

how to use windowScriptObject on the iPhone?

Greetings!
I was wondering how I could use javascript code on an iPhone application I was developing. this tutorial illustrated how to use windowScriptObjects for Cocoa application. However, I have been unable to locate something similar for UIWebViews.
does this functionality actually exist in Cocoa touch? and if yes, could anyone point me to the right direction as to how I might start using it.
thank you once again
Like rpetrich said, this is Non-Public API so the windowScriptObject route might not be the best.
I did find this link though, which helped me a lot:
https://discussions.apple.com/message/7731057?messageID=7731057&#7731057
Basically, if you can keep your interactions between HTML and Objective-C entirely based on the user clicking links ( a href="" )
then all of this can be easily communicated between the two.
While it would be nice, I agree, to exchange variables and call methods at will, this already gives you a lot to work with. Hope that's useful!
This functionality is not exposed via a public API.

rss help in iphone development

Since my last question was deleted without giving me a chance to reply: I want to build a similar rss parser feed to: http://misc.inexistent.org/ontd/
Can anyone give me really good tutorials that I could build a similar iphone app for my rss feed.
I can see it uses jquery, javascript, and ajax.
If any can check out the code to head me in the right direction.
Thanks!
If you are a paid Apple Developer, there is an excellent example project in the developer portal called Top Paid Apps. I've used part of that code in several projects that required XML parsing.
https://developer.apple.com/iphone/library/samplecode/TopPaid/Introduction/Intro.html
That should be all you need to parse an RSS feed and present it in a list view.
The example you have provided is a web page.
So any of the many online tutorials should help you create a browser based RSS parser that will work in a most web browsers, including iPhone/iPad safari, example.
You might then want to style it look more like a native iPhone app, dashcode could probably help you out here.

Categories

Resources