NativeScript TNS App_Resources for Android - nativescript

I am using Nativescript's TNS tool to create application. But when I see App_resources section for android it is different from sample Groceries app. Adding images below. Is there something else I need to do with TNS tool to match the same folder structure?

Because all resources in app_resource/Android/* will be copied to android platform. So, the structures should be the same as android resource directory structure, you can reference Providing Resource.
As matter of fact, my resource directory structure is the same your last image; and it run fine (accept for values directory, I haven't try it yet).

Related

How to create files in working folder on Windows 10 UWP

We have a Universal Windows 10 Platform (UWP) application containing an unmodifiable C library which creates web files in its working folder. These web files are then loaded by the WebView object for display. This architecture is working fine on other platforms, but it fails on UWP due to a lack of write access to the working folder. Apparently in a UWP app the working folder has special ACL protections which prevent creating files. Is there a way to create a UWP app which is permitted to create new files in its own working folder?
Note, we have tried using a different folder but in those cases the WebView object either will not load a file at all or does not load associated xsl, css, etc files. Very frustrating.
Cheers, Bill :-)
There is no way to write to the installation folder. This is by design to ensure seamless differential updates and clean uninstall of apps.
Have you tried setting the current working directory (to local appdata for example) before using the component?
Thanks,
Stefan Wick - Windows Developer Platform

How to deploy multiple shiny apps at the same time?

I've have multiple subdirectories containing some Shiny apps.
Here is the directory structure :
/Documents/shinyapps/app1/ui.R
/Documents/shinyapps/app1/Server.R
/Documents/shinyapps/app2/ui.R
/Documents/shinyapps/app2/Server.R
It looks like it's not possible to deploy multiple shiny apps at the same time using RStudio. I'm using Rstudio: Version 1.0.44
I've tried with this structure as well but app2 is not found:
Documents/shinyapps/app1/ui.R
/Documents/shinyapps/app1/Server.R
/Documents/shinyapps/app1/app2/ui.R
/Documents/shinyapps/app1/app2/Server.R
Maybe try using shiny server.
You can download shiny server and install it in your Linux machine.
Then you can go to the deployment folder (which is usually /srv/shiny-server but can be changed in the config files).
You can either:
create a directory structure in the folder and refer to each app with the different file paths.
Or:
Create an index.html file and arrange your shiny apps to fit in a custom made landing page of your liking. The easiest way is to use iframes.

How do I use symbolic links with Xcode 4 and Cordova

I'm unable to get Xcode to copy over www resources to my PhoneGap based iPhone app. I considered using Git submodules, but since the app has to work on different platforms (iPhone, Android, etc) and has to be branded differently (images, css, and small changes to some files), it does not solve the complete problem.
I ended with a solution where I created an external core www folder and created symlinks for every file from the different projects. If a file needed special attention on a platform or for a branding requirement, then I could simply replace that instance of a symlink with an actual file.
This all would work like a charm, but for some reason Xcode for does not copy the symlinked resources over to the phone. Does anyone have any idea how to make this work? Or a solid alternative. Even if this takes me a day to fix.
Thanks.
This solution worked perfectly to pull in the symlinks on build. Using this method you can build Phonegap solutions for all platforms and have them branded differently with the absolute minimum code duplication.
In short, create a common directory that contains all your phonegap www contents, and then symlink this from your different projects (platform differences or branding differences). For building on Xcode, add the following to your project's run script:
rsync -pvtrlL --cvs-exclude \
$PROJECT_DIR/../Resources* \
$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH
Note: You also need to dereference symlinks if you build for BlackBerry.
I just want to say that using symbolic links shouldn't be necessary. You can simply drop the folder into xcode, and DO NOT copy the files.
In my case, my shared folder was called "mobile", so I did have to create this run script:
mv $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/mobile $BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/www
This simply renames the directory so Cordova can find what it's looking for.

How to deploy PhoneGap app in multiple Platforms

Created one app using phonegap in Xcode, want to deploy that into multiple platforms like android phone and etc.
Can any one please give the answer, how can i achive this.
Take the contents of the "www" folder of your application and copy them into the "phonegap/lib/DESIREDPLATFORM/sample/www" where DESIREDPLATFORM stands for the target platform (I.E.: blackberry, android, etc). All files should be copied, except for the "phonegap.js" file, which is specific to each platform.
after that, go to the command prompt, navigate to the phonegap "sample" folder, and compile the application with "ant DESIREDPLATFORM compile" (you already know what DESIREDPLATFORM stands for). It will create the appropriate package for the platform.
One way of doing that is to create a repository(either public or private depending on your need) of your assets folder and using the phonegap build app, you can find it here: https://build.phonegap.com. I have tested that and it works great.

deploying resource files from xcode

How does one copy resource files (config/data/image) files to an applictions home directory on the iPhone.
A related question Loading Data Files on iPhone?, received an answer "just add them to your project; Xcode will copy them to the .app bundle when it builds your application".
How does one do this? (If this is a simple question, a manual reference/page# is fine)
I want to be able to copy a file onto the iPhone simulator and open it at runtime. I have tried to do this by adding 'copy file' targets, although I havent been able to find the files at runtime.
I know using property list, or sql lite database is prefered over file io, but I would still like to understand how to achieve this.
In my app, I have a sql lite DB which I just dropped in the root of my project folder and added to the resources folder of my project, and it winds up in the bundle, accessible by the app.
http://img68.imageshack.us/img68/3047/xcoderesourceslw5.png
I assume this will work for any file. I didn't have to write any special targets or operations.
In your app, this file then shows up as follows:
NSString *dbFilePath = [[NSBundle mainBundle]
pathForResource:#"dictionary"
ofType:#"db"];
I just found this site, Bundle Programming Guide it explains, how to access resources set in your project at runtime. I assume its just as easy to use single files.

Resources