Xamarin.Forms App Hosting - Switching images from

2020-05-09 10:15发布

问题:

I've builted some apps as demos but I have never uploaded one to the stores.

I'm having doubts about the hositng options (between AWS and Azure). I've been asked to build an app that has promotional images, and the client would like to change the images every month.

I wanted to know whats the best way to build my Xamarin.Forms app so that it can consult this image with a fixed link or fixed name, so that when I need to swicth it with another image, I can do it at the server, and the phone will get that new picture.

I thought about uploadig images to a picture service like IMGUR, and the go to Azure easy tables and change the link (I read Easy tables will desapear Nov 11, 2019 that concerns me https://azure.microsoft.com/en-au/updates/removing-easy-tables-and-easy-apis-from-azure-app-service/).

I also thought about reading a stream for each image and using a website like: https://www.browserling.com/tools/image-to-base64 To convert my image to a stream of text and change that serverside.

I need a list of "Coupons" or images that must change each month.


    <ContentPage.Content>
        <ListView  x:Name="CouponsListView"
                        ItemsSource="{Binding CouponsList}"
                       RowHeight="180">

            <ListView.ItemTemplate >
                    <DataTemplate>
                    <ViewCell>
                        <StackLayout   Orientation="Horizontal" HorizontalOptions="Start" HeightRequest="180" >
                            <StackLayout   Orientation="Vertical" HorizontalOptions="StartAndExpand" HeightRequest="180" WidthRequest="180">
                                <Image Source="{Binding Path=Place.ImgUrl}" HeightRequest="180" WidthRequest="180"/>
                            </StackLayout>
                            <StackLayout   Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="EndAndExpand"  WidthRequest="180" Margin="0,10,0,0" >
                                <Label Text="{Binding Name}"  VerticalOptions="Center"
                                TextColor="Black" /> 
                            </StackLayout>
                        </StackLayout>
                    </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

    </ContentPage.Content>
</ContentPage>

I expect to deploy the App just once to Apple Store and Play Store, and when the client ask for changes I can just go into my server and somehow switch the current list of images with new ones.

If theres something better than easy tables for this I would love to hear your opinions. Thanks in advance.