Getting device name and model using javascript, jquery or php - javascript

I want to create a web page where I can detect the device name and model when visitor view this page from his/her device.

This is not possible in javascript. It does not have the functionality to obtain that much personal information of the user. However, it does have the functionality to tell which browser user is using. These functionalities may be available in a framework like Phonegap but not in core javascript.
Please also refer to this page:
Getting (mobile) device name from javascript

You could use the ng-fone angular module that I wrote for an app to do this.
More details here: http://tphangout.com/?p=83

You can use PHP Class which checks for user-agent to find device information.
One of most used class: http://mobiledetect.net/
This question was asked by another user: Simplest way to detect a mobile device

Related

Call C# from Js in WebView - Xamarin.Forms (iOS and Android)

I need a way to do c# calls to save some data (coming from js function in a webview) in my sqLite.
Thanks in advance!
My guess is that this won't be directly possible in Xamarin.Forms. You will probably need to write a custom renderer for each platform. Here is an article on custom renderers: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/custom-renderer/. You will probably need to write one for the WebView class. Once you've done so, you'll be able to get at the native control and use its underlying functionality. I recommend trying the UWP one first as that will be the most straight forward.
This article explains how to intercept a JavaScript alert in UWP
https://code.msdn.microsoft.com/windowsapps/How-to-intercept-854d33da
But, you will also need to give more detail about what you actually want to do. What data do you want to pass back?

How do I open the Microsoft Office Web Viewer with a search term already applied?

I want to be able to open an Excel sheet using Office Web Viewer, HTML viewing component. (This seems to also be called the "Office Web Apps Viewer".) The viewer component is a really excellent HTML office document rendering engine, but I can find absolutely no documentation online for it. It's even hard to discern what its correct name is. (Does anyone have details on the API?)
I need to be able to load the document and immediately call a JavaScript function to do a search so that the document opens with the search result already highlighted. Even better would be to be able to set the search term in the query string given to the viewer component.
Does anyone know if this is possible and if so, how?
I can say with quite some certainty that there is no such API as the viewer is not intended for such usage. Yeah, I know, not the answer you wished to hear, but then again, that's just the way it is. It's just a viewer, not a component to be used as part of applications.
The quick & dirty solution: Using an extension
One way to achieve what you want is to write an extension that would expose this functionality to you. Of course this would require your users to install this extension, but it is definitely an option and such an extension would be relatively simple to write.
The better solution: PDF.js
Convert your documents to PDF's using some server side solution.
On Linux with OpenOffice.org this could for example look like oowriter -convert-to pdf:writer_pdf_Export doc_file.doc or swriter for LibreOffice.
Present them using Mozilla's cross browser PDF.js library.
Figure out the PDFFindController how to trigger the highlighting. Take a look at this demo and next at this source file. In there they are definitely triggering the highlighting (search for the object I named before), but as it is not directly addressing this question I am not going to figure that one out for you.

How to extend HTML of an existing site via JavaScript or similar

I want to add a bit of extra HTML to an existing site based on a REST API call response.
Specifically, www.arbookfind.com lets you search for kids school books with an "AR" test. (My son has to read a certain number of books at a level.) It has a link to amazon.com if you find a book you want to buy. However I would like to know if available for Kindle (most are not). Right now I have to click the Amazon link, check the page, go back and try next one - it can take 10 tries to find one available on the Kindle. Painful!
I was after ideas of the easiest way to do this. That is, without touching the arbookfind.com web site, can I add some JavaScript (jQuery) to all the returned HTML pages. The JavaScript will look in the returned page for each book, fire off a Amazon ItemSearch query (?) to see if available on Kindle, then inject a HTML link to the Kindle book on Amazon. I can learn how to write the JavaScript - I am just after some pointers for the easiest way to augment the current site.
That way I can use the current arbookfind.com site to find a book, but it is faster for me to identify which books are available on Kindle without manually trying each link by hand.
E.g. a web browser plugin that runs some javaScript on each returned page? A varnish proxy with some smart logic to fiddle pages on the way through? A PHP app acting like as a proxy server? Thanks!
Maybe you want to have something like the chrome extension Tampermonkey.
It allows to add and manage userscripts for websites. Means, a javascript "snippet" which is added to websites maching specific patterns.

Application Craft, PhoneGap and Parse - A match made in heaven?

If I wanted to design apps that required data storage and were targeted for multiple mobile platform's, would using Application Craft to create the UI, Parse to store the data and PhoneGap to wrap it all up for the relevant target device be a potential way of approaching this?
Sorry for the generic question, black and white answers are ok in return.
What would be the biggest limitation to this approach?
To keep it simple, lets say the app is to capture images and text input from multiple users, store it and then display it in some form of activity feed.
I'm not very familiar with Application Craft, but it seems to be a paid version of PhoneGap -- meaning that they each seem to accomplish the same thing so use one or the other (unless I'm missing something...). PhoneGap can use jQueryMobile (or other frameworks) to help with the UI.
If you're going to use Parse within PhoneGap then you will need to find a PhoneGap plugin that allows Parse to work cross-platform. There likely are some, but if not you'll have to develop a separate plugin for each platform.

where to keep the database in a phonegap application

I am new to the Phone gap domain.i have done a small application in android.i just thought of implementing it in Phone Gap and see how it works?
I have used a static database in my android project.i want to use the same for the Phone Gap project?
My big Doubt is where will we keep this Database and how will we access them?
for example..in android we create a Db methods...and store what we want in an array list? and then access them when we want?
for example
instance name = db.arraylistname(id);
column name = instance name.get(0).get("column name");
other doubt is about images.what resolution images(hdpi/mdpi/ldpi/xhdpi) should we use in the www/img/ folder?
which language is better to use in Phone Gap Jquery or java script?
I have used jQuery + jQuery mobile, and they've worked charmingly. jQuery mobile even has some documentation about using phonegap, which can be found at http://view.jquerymobile.com/1.3.0/docs/faq/how-configure-phonegap-cordova.php. I've only used ajax to access external databases, so I can't personally offer any advice on local storage, but this question on SO has a marked answer so it looks like it worked for them: Best database option for PhoneGap applications?
Let me know if you have any questions or want me to clarify anything regarding jQuery Mobile.

Categories

Resources