When targetSdkVersion = 27, the AQuery URL images load good.
But when it equals 28, the images don't load and the image loading place holder is shown.
Any ideas how to solve this so that I can target API 28?
I don't know why, but I added
<!-- for targetsdk 28 -->
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
on AndroidManifest.xml, and AQuery now works again on targetSdk 28.
Related
I have the following code below, where the Image component encompasses two Image component.
<View style={styles.container} >
<Image
style={{width: 50, height: 50}}
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
/>
<Image
style={{width: 50, height: 50}}
source={{uri: 'http://lghttp.24811.nexcesscdn.net/80B00B/qpb/media/catalog/product/cache/11/image/439x334/9df78eab33525d08d6e5fb8d27136e95/q/w/qw_neverdonejoggers_p_.png'}}
/>
</View>
For the first github URL it renders the img logo correctly as expected.
However for the second Image it doesn't render the source: qw_neverdonejoggers_p_.png
Which leads me to the conclusion that something wrong URL, however clicking on the URL correctly load the Img:
http://lghttp.24811.nexcesscdn.net/80B00B/qpb/media/catalog/product/cache/11/image/439x334/9df78eab33525d08d6e5fb8d27136e95/q/w/qw_neverdonejoggers_p_.png
I attempted to replicate the issue here, https://rnplay.org/apps/_dQXXw
but it renders both the images properly.
So its only on the local my computer that for some reason I can render second image ?
Using:
"react": "15.4.1",
"react-native": "^0.39.2",
Andrés' answer is somewhat correct, but it does not address the exact cause of the problem, and that is iOS' App Transport Security. iOS does not allow plaintext requests (http) by default, and so you need to define a 'whitelist' of URLs that can be allowed to override this particular protection mechanism. You have that list already set up so that your app can connect to localhost during development,, so just add new entries to it. You can see how to do so in this answer. Of course, this only works if you know the list of URLs in advance, which might not suit your needs. In that case, have a look at this article.
uri only works with https. In Android it should work fine with either http or https.
You will find further information here.
Guys there is an issue with Image component is that if first time initialize the component with source={{uri : 'some link'}} it may not work (at least not for me when I fetch image from HTTPS URL from Firebase storage). The trick is you have to trigger a change to source props like first you need to keep
source to source={undefined} and then change to source={{uri : 'some link'}}.
Hope it would help someone
Aside issue with HTTPS, make sure you set the width and height of the Image
How i make Image source with http or https url work is by resetting the android emulator am using.
You can clear the emulator by opening the android studio then click on tools tab at the top bar select AVD Manager once it open
Select the emulator you are using, right click on it then select wipe data.
Once that process is completed, open cmd or terminal at the root of your react-native project
$ npx react-native run-android
i have a querymobile/cordova app. i have a function with a for-loop. if i try it in my browser, it works perfekt, but on my tablet, he stops before the loop starts. i don't get an error in eclipse.
here's my code
function listPlan(){
alert("try to parse ics");
cal = $.parseIcs('sdcard/ical/'+aktFile);
console.log(cal);
alert('daten anzeigen');
for (var i=0; i<cal.event.length; i++) {
alert(i);
$('#roosters').append('<div data-role="collapsible"><h3>'+cal.event[i].dtstart[0].value+'</h3></div>');
}
$('#roosters').collapsibleset('refresh');
}
I'm not sure if you can access files on the sdcard using ajax calls.
Try with cal = $.parseIcs('file:///sdcard/ical/'+aktFile);
If it still does not work, maybe should you use the phonegap file api to get the file instead?
Edit:
I've performed a few tests to check access to files on the sdcard with ajax calls on Gingerbread, Jelly bean and KitKat using different urls:
'sdcard/test.txt' (like you're using in your initial code) : does not
work on my test devices
'/sdcard/test.txt' : works in gingerbread and jelly bean
'file:///sdcard/test.txt' : works in gingerbread and jelly bean
'file://sdcard/test.txt' : works in gingerbread but not jelly bean
none of those worked with kitkat (seems that the new webview added some restrictions).
So it seems that unless you tested with kitkat, using $.parseIcs should work.
Maybe the problem comes from some character encoding in your file? You could try to add some debugging code in the parseCalendar function to know why no event is added during the parsing.
Edit2
Surprisingly, on my kitkat device, xhr access to files on the sdcard requires to add the line <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in androidmanifest.xml
I am calling a web service to load video content, and displaying video in webview .
But when i change the orientation then the webservice is Reloading/called again , as activity is calling its oncreate() method.
For this i have used in manifest.xml file :
<activity android:name="ChallengeViewdefinition"
android:configChanges="keyboardHidden|orientation|screenSize"> </activity>
My Requirement:
if in Portrait mode: I want Some Header and one EditText above the VideoView.
If in Landscape Mode: I want VideoView in full screen.(Want to hide edittext and header)
please suggest me.
Is there any way to build a mobile Google Earth-based application that can show dynamic (periodically changing) data?
Here is what I have found
There is no GE plugin for mobile (iOS, Andriod) so the Javascript API is out
There is no supported native API
The NetworkLink RefreshInterval KML does not work on mobile versions (I can't get any part of the NetworkLink KML element to work)
NetworkLinkControl Updates DO work with the Google Earth Application for mobile devices.
Load a KML from the internet - inside this KML, have a NetworkLink such as:
<NetworkLink>
<name>Update</name>
<Link>
<href>URL of Updating KML</href>
<refreshMode>onInterval</refreshMode>
<refreshInterval>20</refreshInterval>
</Link>
</NetworkLink>
So, every 20 seconds GE tries to load the 'URL of Updating KML'
Create the 'Updating KML' - which will have <Update> commands such as:
<NetworkLinkControl>
<Update>
<targetHref>URL of initial KML (one to make changes to)</targetHref>
<Change>
<Placemark targetId="placemarkID">
<visibility>0</visibility>
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
That example would look for a Placemark with the id of 'placemarkID' and change its visibility to 0 (invisible)
My example is using the Change feature of updating, there are also Create and Delete
Here is a Google Example of using Updates
I am facing this issue in Firefox 16.
I created a new svg file (NewImage.svg) with <image> tags:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN'
'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'>
<svg xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
width="224px" height="54px" viewBox="-0.58 -1.162 224 54">
<image xlink:href='background.svg' width='224' height='54' />
<image xlink:href='foreground.svg' x='12' y='12' width='32' height='32'/>
</svg>
When I open this NewImage.svg in Firefox directly, it opens perfectly.
However, when I refer to this svg file from inside my GWT application, the NewImage.svg does not load in Firefox 16. It does load correctly in IE 9.
Gecko does not allow SVG loaded inside to load any external resources, for security reasons (basically to prevent images from phoning home when users won't expect them to). So you need to put any resources you want to use into data: URIs