I want to show an image from http site in Xamarin.Forms. I have tried the following code.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App_ImageUrl.MainPage">
<StackLayout VerticalOptions="Center" HorizontalOptions="Center">
<Image Source="http://45.159.114.25:88/Uploads/Sale/SkuImage/10_9c0d07a145d1418c840c284fbca9614f.jpg" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFill" x:Name="nn" />
<Image Source="https://dkstatics-public.digikala.com/digikala-products/199716.jpg?x-oss-process=image/resize,m_lfit,h_350,w_350/quality,q_60" BackgroundColor="Red" />
</StackLayout>
</ContentPage>
First image does not show, but the second image shows.
Both images are available on the Internet. What is the difference?
As #SushiHangover said one is travelling over HTTP and the other one over HTTPS, iOS and Android have implemented security mesures so you'd need special set ups to be able to make a request to a site without a security certificate.
Related
In my app, I am showing list of websites and on click of each item I will show the particular website with in my app (Detail page). I would like to know is there any problem to show a banner ad (AdMob) in the Detail Page, like Intellectual property violation...etc
In short I would like to avoid app rejection from my Google play store account.
Attaching the XML of my Details Page.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:id="#+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:indeterminate="true"
android:indeterminateTint="#color/tab_checked"
android:max="100"
android:progress="50"
android:visibility="visible" />
<WebView
android:id="#+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/cv_main"
android:layout_below="#+id/progressBar"
android:layout_weight="1">
</WebView>
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="visible">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
Make sure that the banner does not appear over the content but in a sperate place, Ad overlapping with app content (against policy)
You should show in very clear way that you are showing websites that you do not own in this area (Detail page) to avoid Impersonation (unless you own these websites)
Also consider that the owners of these websites could report you to Google and ask for your app to be remove. as mentioned here
We don’t allow apps whose primary purpose is to drive affiliate traffic to a website or provide a webview of a website without permission from the website owner or administrator.
Make sure that your app have other functionality more than opening webpages.
Apps whose primary purpose is to provide a webview of a website without permission:
Also if your app designed for families you cant do this even if you own the app
App functionality: Your app must not merely provide a webview of a website or have a primary purpose of driving affiliate traffic to a website, regardless of ownership of the website.
My recommendation: is not use banner in this case, even though you could do it in a way that does not violate any guideline, your app could be rejected many times and receive violation warnings.
I have an app with a login screen which I coded using NativeScript Angular. I want to use Google Play Pre-Launch Report function. Sign-in Credentials section of Settings page indicates that I need to enter Android resource names of username field, password field and sign-in button.
My question: Where can I find these resource names on NativeScript? Or how can I set them on my TextFields and Button?
Here is my login screen html:
<StackLayout>
<TextField hint="Email" keyboardType="email" [(ngModel)]="user.email"></TextField>
<TextField hint="Password" secure="true" [(ngModel)]="user.password"></TextField>
<Button text="Login" (tap)="submit()"></Button>
</StackLayout>
the hub design is builded in MSN's app, like sport, new, weather.
I want to use that, too.
I study textbook and found that tutorial.
but that only teach add header to hub
<Hub Header="this header"> </Hub>
not include element
in msn app, it has search icon in header.
How to do that?
Hub class has a content presenter in itself and can present HubSection which you can find detailed MSDN page by clicking here
I don't know which MSN app you are mentioning , but if you want to search icon in your Headers you must modify HeaderTemplate to achieve that.
<Hub Header="Text Your Header">
<Hub.HeaderTemplate>
<DataTemplate>
<!-- Put you element here -->
<!-- Below is example -->
<ListBox>
<ListBoxItem>No.1 </ListBoxItem>
<ListBoxItem>No.2 </ListBoxItem>
</ListBox>
</DataTemplate>
</Hub.HeaderTemplate>
</Hub>
I have a simple ASP.NET 4.0 site (no MVC). Just a Master page containing header, menu and footer. I added the script manager in the Master page too. The menu is an ASP.NET Menu control. Everything is OK on my development machine, but as soon as I move it to the GoDaddy server, the menu stops working. This is a dynamic menu loaded from a sitemap.
My problem is that the first time I load it, it just doesn't work. I always get an 'AJAX client-side framework failed to load error' and the "hover" doesn't work. But as soon as I click on one menu item, it changes the page and everything works fine afterward.
I tried a lot of things that I found here and there on the Internet. I put an EnablePartialRendering="True" to my ScriptManager, I added some code to manage ".axd" html handlers. But none of that seems to work.
Here's the code for the menu (test not final so still messy) :
<asp:Menu ID="mnuGauche" runat="server" DataSourceID="sitemap" BackColor="Transparent" RenderingMode="Table"
DynamicHorizontalOffset="0" Font-Names="Arial Black" Font-Size="small"
ForeColor="#7C6F57" Width="100%" Height="20px"
style="margin-left: 0px" Orientation="Horizontal" StaticEnableDefaultPopOutImage="false">
<StaticSelectedStyle BackColor="#5D7B9D" ForeColor="White" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle CssClass="MenuDynamique" />
<DynamicSelectedStyle BackColor="#5D7B9D" ForeColor="White" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" Font-Size="small" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
</asp:Menu>
In my Web.config file, the only thing special that I have is :
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Altough there's plenty of stuff on the web, nothing seems to really work for this menu control. Wich is kind of bizarre because it's one from Microsoft themself. Can anyone help me on that one ?
i want to know what is wrong in this code
<canvas>
<view y="50" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
<resizestate name="res"/>
<dragstate name="drg"/>
<text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
<html id="ht" src="text.html" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
</view>
</canvas>
The code gets compiled but i am not able to see the html in swf version but i am able to see the html in dhtml version. I tried specifying the url too Still no results
It looks like the <html> tag functionality is broken in the SWF10 runtime of OpenLaszlo 5.0 (trunk) for some Webkit based browser (Chrome and Safari), but there are other problems as well. I've modified the code a bit to do some testing:
<canvas>
<button text="OpenLaszlo" onclick="ht.setAttribute('src', 'http://www.openlaszlo.org')" />
<button y="40" text="test.html" onclick="ht.setAttribute('src', 'test.html')" />
<view y="200" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
<resizestate name="res"/>
<dragstate name="drg"/>
<text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
<html id="ht" src="http://www.openlaszlo.org" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
</view>
</canvas>
Here are the results I'm seeing with this code for the SWF10 runtime:
InternetExplorer 9, Chromium 18 and Opera 12: Both pages (local test.html and OpenLaszlo) are displayed within the iFrame.
Firefox: Remote website OpenLaszlo.org displays, but local test.html is not shown.
Safari 5.1 and Chrome 21: Both pages are not shown within the iFrame
I would file an OpenLaszlo Jira bug, and send a message to the laszlo-dev developer mailing list referring to this discussion.
I've been developing in OpenLaszlo since 2006 and my personal experience with trying to use the OpenLaszlo <html> tag under the SWF run-time is that half of the pages I load into it work, half of them don't. I've come across situations where even simple web pages from Google will not work, it is a pretty unstable class, I do not recommend using it.