Where does react native store assets? - javascript

Hi I am developing a react native android app, and I noticed that video assets only work when the device is connected to the internet. That leads me to the question: where does react native store video assets?
To add clarity: I'm using the require syntax for local file (i.e : source={require('assets/file')}; so the files are all inside the actual directory of the folder)
Are the video assets being hosted on a hosting service? (If so, how does this work, why do they do this, and who is paying for this hosting? I'm definitely not paying for anything right now).
Finally, how can I get my videos to work offline? (I've been searching for days and haven't found any solution for this and no mention of this in the actual docs).

Related

NextJS calling dynamic page on production redirects to root

What I want
User enters https://www.example.com/test, user gets content of NextJS dynamic route /test/index.js.
This works locally.
What happens
User enters https://www.example.com/test, user gets content of root page (index.js).
The browser still shows https://www.example.com/test but it's not the content of /test/index.js. This only appears on production.
Infos
Deploying to Firebase Hosting.
The root of the problem was, that I was exporting the NextJS application and using the output as source files for Firebase. The solution for my specific problem was, to set up Firebase functions to really enable serverside rendering instead of displaying served static files. This also solved my routing problem.
I found tutorials to be very misleading, once everyone uses different folder structures and ways to deploy the application.
If you are facing the same problem, feel free to check out my repository. It is a combination of the Firebase config, package.json and server file working together - taking in account different folder paths for exporting for development and production.
These resources were helpful to me:
Overall Tutorial: https://itnext.io/deploying-next-js-app-to-firebase-functions-eb473791d79e - This is missing some steps regarding function names.
Great for understanding what each file does: https://github.com/jthegedus/firebase-gcp-examples/tree/master/functions-nextjs
Nice for understanding ways of rendering: https://codeburst.io/next-js-on-cloud-functions-for-firebase-with-firebase-hosting-7911465298f2
This made me understand how to use Firebase function names correctly: https://github.com/vercel/next.js/tree/canary/examples/with-firebase-hosting

Should I include all my sources in my PhoneGap app, or request them from a remote server?

I'm currently trying out PhoneGap, and by the looks of it I'll probably need to use at least one framework: jQuery Mobile, Bootstrap, whatever. Either way, I'll need to reference that code in my app's index.html. I heard that when you do that on a website, you should always request code from a (popular) CDN because unless you're requesting a super-new version of the framework, there's a good chance the client already has a cached copy. Is this the same for apps?
I would include it in the app. A PhoneGap app runs entirely from your phone, unlike a website, which you fetch from the internet. If you use a CDN your app now requires the user to have an internet connection to use the app. Depending on your app, this might not be a big issue if it already requires a connection to work properly.

Is it possible to update HTML/CSS/JS files in a PhoneGap app with out re-deploying?

If a user has installed my PhoneGap app is there any way to update the static files such as the HTML or CSS with out the need to re-deploy the app again?
For example, when updating a web app, the developer can make a change to a CSS file on the server, and on the next page refresh the style change will be visible to the user.
I'm assuming being able to do this is unlikely due to the app needing to be packaged up and installed on the device, but I'm looking for some verification.
You could change the app to import the file externally from a server (something like <link rel="https://linktofile.com/file.css">, which means you can change the app's style at any time without re-compiling the app.
Otherwise I am not aware of any other way.
#Stavros_S
delopying a website as is suggested by Praveen Kumar is NOT best practice for mobile Apps.
Recently, Google created a new means to do what you want. It is called an Expansion File. Read this:
https://iphonedevlog.wordpress.com/2014/12/12/adding-an-android-apk-expansion-file-to-a-cordova-project/

How to serve a very simple, raw, Ember.js application?

I believe this can be considered a very silly question, but I'm really stuck on it for some time. I have a very simple Ember.js application (that means I am not using Ember-CLI) and since I am using the Facebook SDK in it, I need a valid domain.
Until now, I've ran my app simply by double clicking the index.html file in the browser.
Then, in order to have a domain for my app, I've tried using nginx inside a Docker container (so that I can add the http://<docker-ip> URL in my Facebook settings). The problem was that nginx (with the default configurations from the official Docker image) was somewhat loading a stale version of both JS files and index.html, even though the container had the latest versions of the files. I've even tried destroying the container, then starting it again and the issue persisted.
I've then tried looking at other approaches, but none satisfied my need of something simple:
node.js server, too much for serving a very basic app;
middleman, too much setup because I don't need to compile stuff (no .hbs, no less etc.);
ember-cli server, doesn't work with a normal Ember.js app;
other small JS servers, had to configure them too much for just serving some static files;
GitHub Pages and S3 do work, but...I don't want to deploy each time when developing.
So, please help me in this silly quest, how can I serve a basic Ember.js app (preferably from a Docker container)?

Phonegap localStorage not backing up to iTunes

So I'm building an app using Phonegap and have come across an issue in my ad hoc testing phase.
After installing the app on my iDevices, I've tried to back up the data contained within localStorage to iTunes. For some reason, none of the things I've saved to localStorage seem to be retrieved when I re install the app. I've changed BackupWebStorage in my config file to "local" but that has not helped.
I know that ios 5.1 created many issues for localStorage being backed up and am wondering if that's still the case. If so, what would be my best alternative to localStorage? I'm content with using the File API or a local SQL database, I just need some direction before I rewrite a large amount of code.
Thanks!

Categories

Resources