I have checked out the forum a lot and there are many similar question to this, but none have the answer what I am looking for so hope someone can help me!
I am building an app with phonegap and it have previously worked fine. Now it was time for an update of just some text and images in it, but also decided to get the newest version of everything.
I can launch my app on android just fine, but as soon as I click on a link to another page (internal) I get the following error:
net::ERR_FILE_NOT_FOUND(file:///android_asset/www/html/feriehus.html)
It used to work with the following code in the index.html, but does not anymore...does anybody know why?
<li><img src="img\feriehus.png" width="40"></li>
Kind regards, Kiam
Edit: Added images to show their location:
the root of www folder where index.html is located
The location of ferirhus.html is located
Change folder name from html to some other name. Because html is a reserved word so it might be creating problem.
Related
I have image file on device in Android/data/myApp folder called test.jpg. I want to display it in img tag. I've tried every possible path in src attribute but nothing works. I've also tried change src to ng-src or data-ng-src. Nothing works and I am getting desperate.
The image is visible in storage when I look through windows explorer but it doesn't in my app. If I use $cordovaFile.checkFile function, everything looks perfect in the result data. File exists, has nativeURL but still doesn't show in the view.
Anyone had this problem? I've read everything google has to offer in this topic, but still without any progress on this issue. Can someone show me some simple example how to retrive image in Ionic app from device storage? What path should look like? Maybe I have to add some permissions to my config.xml or andorid manifest?
It's my first hybrid App. I don't have much experience in AngularJS/Cordova/Ionic.
I've really stuck. Please help.
Ok, so I guess I have to answer this question myself. Everything works fine now when I use nativeURL of the file as src. I've added img-src: *; to the content of http-equiv="Content-Security-Policy" meta tag in index but it still didn't work. After 10th time restarting app suddenly everything was fine. I still don't know if this was problem with meta tag but it work now so I am happy.
If anyone want to see my config.xml, manifest or index just ask.
I'm looking for a possibility to browse the android API guides offline (with figures). I read several questions about this here (ex. 1, 2, 3...) and tried to get offline docs from the sdk folder or using a direct link. The problem with the actual version (23_r01) is that the images are often not displayed. For example in the page sdk/docs/design/index.html the image hero-material-design.png could not be displayed because of a bad src tag.
What I've tried:
Using the docs from the SDK folder
Direct download from https://dl-ssl.google.com/android/repository/docs-23_r01.zip
Saving the files using HTTrack (I'm getting errors here..)
What I would like to achive:
Download a correct version of the docs
OR "Repair" all the broken image paths in the html files
I would appreciate any help.
If thats still interested to you, just edit \docs\design\index.html, add .. before /design (it means the parent folder, one dot means the current), like that:
<img class="dac-hero-image" src="../design/media/hero-material-design.png">
I am trying to build my angularjs app into an android app using PhoneGap Build, but got stucked with the issue of the src of ng-include.
The code below tries to render a html of subheader into the view. It works perfectly in chrome browser, however after I convert the code with phonegap, it does not work. I also tried other path like '../templates/subheader.html' and '/templates/subheader.html', none of them work.
<div class="bar bar-subheader bar-stable" ng-include="'templates/subheader.html'">
</div>
Any suggestions?
It is embarrassing to always answer my own question...
However I finally figured it out.
1. The path inside the ng-include should not have the "/" on its left most.
2. The key of this issue is not the ng-include. It is because I was trying to fetch a variable stored in the $cookieStore:
For some reason I don't know, the data stored in $cookieStore can't persist between page transition. It impact many components in my page. So I have to change the $cookieStore to another local storage service https://github.com/grevory/angular-local-storage.
I had the same problem, that my include was not shown on the device.
But my problem was that I put the template in an folder which's name started with an underscore _.
This is ignored in the build-process. Renaming the folder helped!
Did you have a chance to look at Ionic Framework ? It works on phonegap and has build in AngularJS support. It also has some mobile ready components.
I have one simple question conserning PhoneJS http://phonejs.devexpress.com/Documentation
and it's demos - how to launch and preview them on Android devise?
I've loaded a package and tried to run demos through Eclipse, using
webView.loadUrl("file:///android/html/index.html");
But only black screen is visible.
Thanks!
I also not found this PhoneJS information in documentation. I wrote to support and they told me PhoneJS application is like any PhoneGap based application can be packaged with PhoneGap and in http://build.phonegap.com site.
PhoneGap Build worked well, but it is little slow.
Do you see any errors or simple black screen?
Possible files, mentioned in the index.html file, are spelled in the different case from files on the disk, e.g. you have line
script type="text/javascript" src="data/db.js"
but on the disk there is "Data" (not "data") folder or "Db.js" (not "db.js") file.
It makes sense then application is uploaded on android device. You should ensure file names spelling.
Thanks, Serge
I am making an app in which i am using fusion charts and when i use "file:///android_asset/www/indexx.html" (which contains html and js code) and when it loads it shows page with no image and white background means no chart is displayed.Can anyone help me in this.Any help will be appreciated.Can anyone help step by step method to implement fusion charts.I have read the given page of stack overflow FusionCharts in Android? but it couldnt help me.
Thanks.
Have you put all the .js files(FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js, and jquery.min.js) in the asset or www folder?
because generally in Web Apps when .js files are missing or the Path error is there at that time this problem arises.
Please share a code snippet!