середа, 30 вересня 2020 р.

Online graphical editor

Online graphic editor:

https://sketch.io/sketchpad/

Gives a possibility to create very nice vector graphic images, has a large library of sampled objects.

понеділок, 21 вересня 2020 р.

Xamarin: Right-bottom button over the controls

If you're finding a way how to design a buton over the controls, it looks like this:

    <ContentPage.Content>
    <RelativeLayout>
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="30" />
          <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.Triggers>
          <DataTrigger TargetType="Grid" Binding="{Binding IsBusy}" Value="True">
            <Setter Property="IsVisible" Value="False" />
          </DataTrigger>
        </Grid.Triggers>
        <StackLayout 
                Grid.Row="0"
                Grid.Column="0">
          <Label Text="List"
                       FontAttributes="Bold"
                       FontSize="Large"
                       VerticalOptions="Start"
                       HorizontalOptions="Center"
                       Margin="0, 0, 0, 0" />
        </StackLayout>
        <StackLayout 
                Grid.Row="1"
                Grid.Column="0"
                Margin="10">
          <ListView
                    x:Name="list"
                    ItemsSource="{Binding List}"
                    IsVisible="True"
                    SeparatorVisibility="Default"
                    HasUnevenRows="true"
                    ItemTapped="List_ItemTapped"
                    SelectionMode="Single">
            <ListView.ItemTemplate>
              <DataTemplate>
                <ViewCell>
                  <StackLayout
                                    x:Name="Item"
                                    Orientation="Horizontal"
                                    HeightRequest="190"
                                    >
                    
                    <StackLayout.GestureRecognizers>
                      <TapGestureRecognizer
                                            NumberOfTapsRequired="1"
                                            Tapped="Item_TapGestureRecognizer_Tapped_1"
                                            CommandParameter="{Binding Source={x:Reference Item}, Path=BindingContext}"
                                        />
                    </StackLayout.GestureRecognizers>
                  </StackLayout>
                </ViewCell>
              </DataTemplate>
            </ListView.ItemTemplate>
          </ListView>
          <Label Text="Brak kart w aplikacji"
                       VerticalOptions="CenterAndExpand"
                       HorizontalOptions="CenterAndExpand"
                       IsVisible="{Binding IsEmpty}"
                       />
        </StackLayout>
        <ContentView Grid.Row="0"
                         Grid.Column="0"
                         IsVisible="{Binding IsBusy}"
                         BackgroundColor="#222222" 
                         Opacity="0.5"
                         AbsoluteLayout.LayoutFlags="All"
                         AbsoluteLayout.LayoutBounds="0,0,1,1"
                         >
          <ActivityIndicator IsRunning="True"
                        Color="{StaticResource ButtonBackgroundColor}"
                        VerticalOptions="CenterAndExpand"
                        HorizontalOptions="CenterAndExpand" />
        </ContentView>
        
      </Grid>
      <RelativeLayout x:Name="PlusButton" 
                        WidthRequest="100"
                        HeightRequest="100"
                        HorizontalOptions="End" 
                        VerticalOptions="End"                      
                        RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0,Constant=0}"
                        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=1, Constant=0}"
                        RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1,Constant=0}"
                        RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width,Factor=1,Constant=0}"
                          >
        <ImageButton                             
                        Source="plus.png"
                        BackgroundColor="Transparent"
                        Clicked="PlusButton_Clicked"
                    />
      </RelativeLayout>
    </RelativeLayout>
  </ContentPage.Content>
</ContentPage>

Bold is actually that RelativeLayout with the plus Image (buton). If you'd like to move the buton somewhere else, you have to change Factor value.

середа, 2 вересня 2020 р.

Helpful adb commands (How to stop an Android Emulator from Command Line)

Find adb.exe on your computer.
You have to use
adb kill-server
or
adb -s emulator-5554 emu kill
, where
emulator-5554
is the emulator name.
For Ubuntu users:
adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done

# Fully Uninstall an app on an emulator:
adb shell "pm uninstall <your packet name, f.e. com.nl.hello.world>"

# Uninstall an app on an emulator with the local data saving:
adb shell "pm uninstall -k <your packet name, f.e. com.nl.hello.world>"

# Install a previously copied app on an emulator:
adb shell "pm install -r /storage/00BC-1AFD/temp/v1.0/<your packet name, f.e. com.nl.hello.world>.apk"

# restart adb to be able to use device via WiFi
 adb kill-server &&  adb start-server && adb tcpip 5555 && adb connect 192.168.0.14:5555

# How do I find out which keystore was used to sign an app?:
First, unzip the APK and extract the file /META-INF/ANDROID_.RSA (this file may also be CERT.RSA, but there should only be one .RSA file).
cd "c:\Program Files (x86)\Android\android-sdk\platform-tools\"
keytool -printcert -file ANDROID_.RSA

# Then use the keytool again to print out all the aliases of your signing keystore:
cd "c:\Program Files (x86)\Android\android-sdk\platform-tools\"
keytool -list -keystore my-signing-key.keystore