open html file on sdcard with phonegap and jquery mobile - jquery-mobile

i have some HTML files that users can download in runtime to sdcard. Now i want to create a link in my app to open those files. The problem is, i do not know what i should write in href property of the link tags to open the HTML files on sdcard
can anyone help me?

In the congif.xml file from my Blackberry app project locate on:
C:\Dev\phonegap\BlackBerry-WebWorks\<project_folder>\www
there are this lines:
<!-- PhoneGap API -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
That config is granting access to those URI/resources, i think you can play around with that.
I have no idea how will be this URI on other plataforms, but is a good point to start the testing,
Good Luck!

Related

Can you deep link to an app from a Squarespace hosted website?

I want to implement deep linking in my app. I've read that to implement deep linking you need to put a json file in the root of your website which will then redirect users to the app if they are on a mobile device and the app is installed. I have a Squarespace site, but placing the json file in the root folder of the squarespace files doesn't seem to work. I assume this is because I would need access to squarespaces' own root.
So my question is, can I implement deep linking with a Squarespace site? If so, what have I done wrong? If not, is there an alternative solution, or should I create a new website that I have full access to?
I checked with Squarespace support... first rep was decent, but didn't have the depth, so he sent it up the chain.
Eventual response: Nope, even in their "developer mode" you cannot get the file in the right place with the right MIME type.
Time to look for a different hosting service, or consider Alex Bauer's comment.
A couple notes:
The file must be on https:// - plain old http:// won't work.
The file cannot have an extension - so no .json on the end.
The file' MIME-type must be set to application/json. This can be a hassle, as standard web service sets MIME-type by extension.
Otherwise - it's fairly straight-forward :)
The requirements around hosting the apple-app-site-association file needed by Universal Links are quite strict. I doubt it is possible to satisfy them with the standard Squarespace system, though it might be possible via Developer Mode.
As a workaround, you could add something like the Branch.io Smart Banner (full disclosure: I'm on the Branch team). This won't make your site URLs active for Universal Links, but it will make it easier for users to transition between your site and the app.
I found a soloution.
You can enable a URL Mapping to point on appname://location/xy
This is not a soloution for universal links but you can handle deeplinks in that way.
Hope this helps.
I don't think this is a Squarespace issue as much as a maybe a design issue. If you register the appropriate intents you can make a 1 page to 1 view association in your app. The example below is Android but you can do similar on iOS
Case:
Web Address: www.abc123.com/news
App Page: News
Example Intent (Android)
<activity
android:name="com.abc123.android.NewsActivity"
android:label="#string/title_news" >
<intent-filter android:label="#string/filter_title_viewnews">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.abc123.com"
android:pathPrefix="/news" />
</intent-filter>
</activity>

How to make a phonegap application point to a certain URL?

I found other questions about this and I tried the suggested answers which were as follows.
Adjust the config.xml file:
I changed this <content src="index.html" /> to <content src="localhost:3000" />
and also
<access origin="*" /> to </content src="localhost:3000" subdomains="true">
But everytime I launch my application, it is still referring to the index.html file.
I am only trying it on iOS platform.
For testing purposes, I am trying the webpage online everytime, I launch the application using phonegap serve form the CLI, the webpage (localhost:3000), still refers to index.html
Any insights on that?
You cannot point a device to localhost as localhost is an alias of 127.0.0.1 which is not reachable over a network.
You need to point to the actual IP address of the machine that is hosting your code.
Example:
<content src="192.75.64.231:3000" subdomains="true" />

How to whitelist unknown domains in blackberry 10 and webworks sdk?

I know that to access an external link, one has to whitelist the access path in config.xml.
My problem is that I am unable to use asterisk as the whitelist option. Ripple emulator does not let me do it. My app downloads a number of image links and then display those images. These images could come from any number of sources/ domains. Now how do I mention an intelligent whitelist for this purpose?
My Environment:
BlackBerry 10 WebWorks SDK 1.0.4.11
BB10 Simulator
Windows 7
The way you do that is adding this line in the config.xml file:
<access subdomains="true" uri="*" />
But there's a quirk that renders this option useless whenever you use ajax. From the docs:
You can specify a wildcard () for the uri to whitelist any domain, but only for domains that do not access application APIs and that do not access content through XMLHttpRequest. If the domain requires access to APIs or accesses data through XMLHttpRequest, you must explicitly specify the domain in the uri.*
As Mister Smith said above, the proper way to 'whitelist' a domain is by adding the wildcard access element to your config.xml
<access subdomains="true" uri="*" />
You also have the ability to disable all web-security. While this is not the first recommended approach to dealing with cross origin requests, it's sometimes needed, especially when talking to services that use a CDN. To disable all web-security you'll want to add the following to your config.xml
<feature id="blackberry.app" >
<param name="websecurity" value="disable" />
</feature>
Lastly, your Ripple issue is something separate from all of this.
Go to manage your Chrome extensions, find Rippe, and check the box that says "Allow access to file URLs", and add the following flag to your Chrome shortcut --allow-access-from-files

Use FusionCharts in sandbox solution

Has anyone been successfully rendering charts using fusion charts in a sandboxed solution?
How would you get the SWF file onto SharePoint? I included it and deployed it via feature and the Elements.xml looks like the following:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="FusionCharts">
<File Path="FusionCharts\FCF_Column2D.swf" Url="FusionCharts/FCF_Column2D.swf" />
<File Path="FusionCharts\FCF_Gantt.swf" Url="FusionCharts/FCF_Gantt.swf" />
</Module>
</Elements>
When the sandbox solution is deployed, you can access the SWF file from http://sharepointsite/FusionCharts/FCF_Gantt.swf, the browser will attempt to open/save the file. If this file is deployed via farm solution, and be deployed to _layouts folder, which I can access via http://sharepointsite/_layouts/FusionCharts/FCF_Gantt.swf, it renders with error message "invalid xml data". The farm solution deployment is correct because MIME type is properly set to "application/x-shockwave-flash" and thus my custom web part which renders chart using this SWF file works. But if my sandboxed web part is to use the SWF file deployed as site pages, it does not work. Any idea?
Thanks in advance.
Sean
The problem is resolved with help from DevExpress team. Though SWF can be deployed to SharePoint site document library, you would need Farm Administrator to go into Central Admin pages and set the property in Application Management for the Web application to allow "Permissive". Go to Central Admin -> Application Management -> Select Web Application -> General Settings (Ribbon button), change "Browser File Handling" from "Restrict" to "Permissive".

Phone Gap , Blackberry environment reference external JS file

I am using Phone Gap Blackberry environment for creating apps targeted OS6.0 & above.
In the index.html, inside the head tag i am referencing the external JS file, which actually contains the data needed for my application.
EG: www. google .com/js/data.js
In the project config.xml i have also referenced the the site
EG:< access subdomains="true" uri="http :// www.google.com" />
The issue here is, i dont see the data.js file being called. This works fine with Android & Iphone environment.
Am i doing something wrong here???
In your config.xml, you need to also provide access to the google.com domain, otherwise your app won't get access to google.com and won't be able to download the script file. From your post, it looks like you only provided access to nyigf.com.
You need to add an additional element to your config.xml, i.e.
<access subdomains="true" uri="http://www.google.com" />

Resources