I have png image in the Assets\NavImages\ folder in my WPF Assembly - EhLib.WPF.
And I refer to this file in the Image.Source line as follows.
<Image Source="pack://application:,,,/EhLib.WPF;component/Resources/NavImages/DataNavigator_First.png"
Stretch="None" />
Now I port my Assembly to WinUI and try to use next line .
<Image Source="ms-appx:///Assets/NavImages/DataNavigator_First.png"
Stretch="None" />
to refer to the similar file in the new Assembly - EhLib.WinUI.
But it doesn’t work.
The picture is not displayed.
This only works when the file is located in the main assembly of the executive application.
I can't find any useful information in the documentation.
https://learn.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.image.source?view=winui-3.0#microsoft-ui-xaml-controls-image-source
This works only if you set the Build Action of the image to Content and copy it to the output folder:
<Image Source="ms-appx:///ClassLibrary1/Assets/NavImages/DataNavigator_First.png"
Stretch="None" />
I am afraid that embedded resources cannot be extracted using the ms-appx URI scheme. You will have to extract these programmatically yourself.
I'm an Android developer and I'm trying to develop a custom Android Auto app, that does a simple mirroring of the phone screen.
I know that currently the API are only available for music and messaging apps, but I would write an app for mirror a simple "hello world".
I follow the Google Getting Started tutorial and I'm using the Desktop Head Unit (DHU) provided by Google (at developer.android.com/training/auto/testing/index.html)
but when I tap last button on the bottom of the display and select "All car apps", my application doesn't appear on the list.
All car apps
For example, if Android Auto is launched in a Samsung tablet (SM-T555), the DHU lists these app:
com.google.android.gms, Maps, System UI, Video, SampleAuthenticatorService, SecureSampleAuthService, Screen capture, Android Auto, Phone, Media, Return to Google, Samsung Billing, Google App, Google Play Music, Music
Available Car Apps in a Samsung Tablet
How can I make an app that is displayed on the available app list in Android Auto? Is possible do mirroring for a custom app in Android Auto?
Create a service like this:
public class HelloWorldService extends CarActivityService {
#Override
public Class<? extends CarActivity> getCarActivity() {
return HelloWorldAutoActivity.class;
}
}
Then add the service to your manifest like this:
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="#xml/automotive_app_desc" />
<service
android:name=".HelloWorldService"
android:exported="true"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION_OEM" />
</intent-filter>
</service>
Finally create a xml file called automotive_app_desc under your res folder:
<automotiveApp>
<uses name="service" />
<uses name="projection" />
<uses name="notification" />
</automotiveApp>
Your HelloWorldAutoActivity.class will work as your MainActivity.
Android auto not customized. some api (audio, map, contacts) are same, customized.but you can dolittle things. pls check this
https://github.com/Mutesham/AndroidAuto_TextApp
In order to have app displayed on the Auto. You will have to upload it to playstore on beta channel.
The Main Activity File
The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application −
package com.example.helloworld;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
The Manifest File
Whatever component you develop as a part of your application, you must declare all its components in a manifest.xml which resides at the root of the application project directory. This file works as an interface between Android OS and your application, so if you do not declare your component in this file, then it will not be considered by the OS. For example, a default manifest file will look like as following file −
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tutorialspoint7.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The Strings File
The strings.xml file is located in the res/values folder and it contains all the text that your application uses. For example, the names of buttons, labels, default text, and similar types of strings go into this file. This file is responsible for their textual content. For example, a default strings file will look like as following file −
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building its interface. You will modify this file very frequently to change the layout of your application. For your "Hello World!" application, this file will have following content related to default layout −
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="#dimen/padding_medium"
android:text="#string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
I am new to Xamarin and I am creating UWP application. I wanted to know From where i can set app icon image. I had gone through may articles and question on stack-overflow that looks similar, but it still its not clear..
So my Question is exactly where i should change my image for logo. only 24x24 as shown in below image.then what are the others badge logo and etc.?
should i change all images for logo with all dimensions also?
AppxMainfest.Xaml
<?xml version="1.0" encoding="utf-8"?>
<Package ...>
...
<Properties>
<DisplayName>StockDispatchApp.UWP</DisplayName>
<PublisherDisplayName>pci207</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10586.0" />
</Dependencies>
<Resources>
<Resource Language="EN-US" />
</Resources>
<Applications>
<Application Id="App" Executable="StockDispatchApp.UWP.exe" EntryPoint="StockDispatchApp.UWP.App">
<uap:VisualElements DisplayName="StockDispatchApp.UWP" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="StockDispatchApp.UWP" BackgroundColor="transparent">
<uap:LockScreen Notification="" BadgeLogo="Assets\96x96.png" />
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"></uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
...
The MSDN documentation provides clear description of where each of the images is used. In the bottom you can see Asset size tables tables which contain all the dimensions and their usage.
As for the Square 44x44 logo, the first five images in the first row are used for different scales in the app list.
The target images are used for app icons in different places around the system. In their unplated form, they should have transparent background. You can provide just the sizes recommended by the form, but you can also provide more sizes (see the documentation for the complete table).
You don't need to worry about this, you can simply generate all the icons from Visual Studio 2017.
Go to App manifest and click on Visual Assets In all visual assets
There is option called Asset Generator, select at least a 400x400 px
icon file size for the source field
And tap generate And here you get
the all icons.
For reference please have a look at the attached screenshot.
I have created an working WiX Patch but during it's installation it does not show the product background image.
The original product setup dialog shows the images and they are defined in it's project like:
<Product ...>
<WixVariable Id="WixUIBannerBmp" Value="gn_setup_dialog_banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="gn_setup_dialog.bmp" />
The patch is created and works fine. The problem is that it does not show these images. It shows some default background for the dialog.
Here is my patch if this helps:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Patch AllowRemoval='yes'
Manufacturer='xxx'
MoreInfoURL='...'
DisplayName='...'
Description='Small Update Patch'
Classification='Update'
Codepage="...">
<Media Id='5000' Cabinet='RTM.cab'>
<PatchBaseline Id='RTM' />
</Media>
<PatchFamily Id="HotFixPatchFamily" Version="1.0.1.0" Supersede="no" />
</Patch>
</Wix>
Thanks for helping.
For some reason the patch was delivering these two files as "new" ones...even tough they were not changed.
Anyway, I solved the problem by replacing the stock Wix dialog images, like it is suggested here (at bottom "Replacing the stock bitmaps"):
http://wix.sourceforge.net/manual-wix2/WixUI_dialog_library.htm
I am looking for a format of the location data used by the Windowws Phone Emulator Additional Tools. On the tab "Location" there is an option to save/open recorder data. I ask this question because I need simulate geo position change but Location Tab doesn't work for me. As a workaround I am going to create a file of the location data and open it in the emulator.
It's a simple XML file in this format:
<?xml version="1.0" encoding="utf-8"?>
<WindowsPhoneEmulator xmlns="http://schemas.microsoft.com/WindowsPhoneEmulator/2009/08/SensorData">
<SensorData>
<Header version="1" />
<GpsData latitude="" longitude="" />
<GpsData latitude="" longitude="" />
<GpsData latitude="" longitude="" />
</SensorData>
</WindowsPhoneEmulator>
Answered thanks to "Konaju Games" user at AppHub forum (http://forums.create.msdn.com/forums/p/91880/550593.aspx)