ionic 3 app show image on browser but dont on android device - android

Thanks for any help, and sorry about my bad English, we speak Portuguese on my country...
ionic 3 app show remote image provided by api on browser with ionic serve but dont on android device, debug on chrome get this error:
7fa1ea1d73789d207ef51e6941913d5e_image.jpg:1 GET http://localhost:1337/parse/files/myAppId/7fa1ea1d73789d207ef51e6941913d5e_image.jpg net::ERR_CONNECTION_REFUSED
any help...

I think you might have use relative paths for images like <img src="../assets/imgs/logo.png">
Don’t use relative paths for images instead use absolute paths like<img src="assets/imgs/logo.png">
Please refer below link for more details:
https://forum.ionicframework.com/t/images-not-displayed-on-device/89145

If you want yo use localhost images when running on the device with ionic run android ——device —lc you should use your api address instead. You can see it with the command ipconfig in your terminal

Related

Ionic CSS changes are not persistent when after ionic serve / cordova run android commands

I am developping an app on Ionic version 3.9.2, for android tablets. I am working under windows 10 with Visual Studio Code.
In my plaform folder, I have only one device : my physical Android device.
The way I process to fix some CSS details is that I simply launch a
ionic serve command, find my HTML element, and update the main.css file located in the www/build folder (I am not using SCSS).
This works okay until I decide to check if everything looks good on my android tablet : I will launch a cordova run android, and then all the CSS changes are lost - even if I go back on my browser, and launch a new ionic serve.
Please note that I am talking about very basic styles, like colors and font size, not platform-specific styles.
I am not sure this behavior is because of the target device itself; it's looks like the changes will be included successfully on my testing platform until I decide to change the platform, and then the new platform will erase my changes because it's taking over the building process.
Is that possible ?
Maybe should I stop switching between those 2 commands ?
Or maybe should I edit both CSS files (www/build/main.css and platforms/android/assets/www/build/main.css) at the same time, which require a lot more work ?
Any help appreciated.
Oh of course, I shouldn't edit this CSS file.
Instead, edit the right SCSS file inside the SRC folder.
Thanks for your answer.

External resources in phonegap app after build

This is my first post on SOF. OK, let's get to the merits...
Im quite new in Phonegap and mobile applications world but i have some expirience with developing in PHP, C#, JS... but in Phonegap iam stuck in early stage.
I download Phonegap app for windows to testing apps, this software create for me fresh project.
Now i add to index html: <img src="http://domain.com/img.png" />.
In desktop phonegap image is visible but after build i see crash link to image icon. I tested this on Andy emulator and on my HTC ONE - the same effect.
I tryed with jquery link, api connection, nodejs+socket.io external resources in my app, in the next step with additional attributs in html markups, in the next step i used many different config.xml combinations (changing/deleting sections with domains ACL).... i have only one configuration file. ( i builded .apk on adobe web page)
...and I still have this problem.
What could be the problem ? What should I check? how should I debug/test ?
thank you in advance and sorry for my English .
try after Addind <access origin="*" /> in your config.xml file
I had this line in my first approach in config.xml and i check this position witch , domain.com, domain.com, domain.com/picture.png and with option "subdomains" ... and this is not issue in this case.
thanks!

Running website on Android Device from file

I have a web application I've built using the Jquery mobile framwork and I need to put it on my phone for demonstration purposes. What is the best way to go about this I was going to use phone gap but I want and easier solution say I just put the files onto my phone and run it from within the device but I don't know if that's possible. If anyone has any ideas I'd greatly appreciate it
Phonegap build would be the easiest way! Here is a link to the documentation http://docs.build.phonegap.com/en_US/#googtrans(en)! It gives you a qr code to download a test to your android device before releasing, sorry no ios tho!
Hope that helps! Littleswany
Would a simple WebView work for you? You can also use local files instead of downloading the site/assets from a web server.
http://developer.android.com/reference/android/webkit/WebView.html
Just thought of another way, If you have adobe cc then you could use edge code and edge inspect and the android app to have a test server on your device.
Sorry for the second answer but again I hope it helps you! Littleswany!

Get jQuery w/ Android Cordova Links to open in browser

I have an Android cordova app, and I use jQuery Mobile for the interface. Basically I am trying to get certian links to open in a browser window instead of cordovas childbrowser.
I have some code here, that I think should work, but i can't seem to debug. Could someone take a look?
http://t.co/kAJ7mrj5
Although I'm not certain if this is the problem, I see this attribute:
onclick="navigator.app.loadUrl(http://forum.xda-developers.com/showthread.php?t=1703488", {openExternal: true});
I think that should be:
onclick="navigator.app.loadUrl('http://forum.xda-developers.com/showthread.php?t=1703488', {openExternal: true});"
Notice the quotes.

Get page source of a web page running in the emulator while the script used is running in the local machine?

Here's what I need to do,
I need to get the page source of a web page running inside the emulator.
The script that is going to perform the task is running in the local machine.
The script is made using monkeryrunner.
any ideas? thanks!
There is a blog post I read about this just the other day:
http://dtmilano.blogspot.co.uk/2012/11/androidviewclient-getting-browsers-html.html
I believe it will only run in the emulator but you have that in your tags so it is likely this will do exactly what you want!

Categories

Resources