Android Wear companion activity gear does not show up in watch face - configuration

I wanted to provide a Companion Configuration Activity for my Android Wear watch face. I have already build the app that has all the configuration and can communicate directly with the watch face, but I can only launch it from the launcher as app, but the gear does not show up in the watch face section of Android Wear app! Can I allow user to configure the watch face via companion app and also via Google Android Wear app?
This is how I declare my activity in phone module:
<activity
android:name=".Main"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:mimeType="image/*"></data>
</intent-filter>
</activity>
On the watch part, I added in:
<meta-data
android:name=
"com.google.android.wearable.watchface.companionConfigurationAction"
android:value=
"virtualgs.photowatch.Main" />
<meta-data
android:name=
"com.google.android.wearable.watchface.wearableConfigurationAction"
android:value=
"virtualgs.photowatch.Main" />
And the result is the same - no gear shown on the Android Wear app.

Try something like this:
Phone Manifest:
<intent-filter>
<action android:name="com.virtualgs.photowatch.MAIN_CONFIG" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Watch Manifest:
<meta-data
android:name="com.google.android.wearable.watchface.companionConfigurationAction"
android:value="com.virtualgs.photowatch.MAIN_CONFIG" />
I think the intent action in the phone manifest has to be the same as the meta-data value in the watch manifest to work.

I think this is the correct answer about XML file config:
<activity
android:name=".DigitalWatchFaceWearableConfigActivity"
android:label="#string/digital_config_name">
<intent-filter>
<action android:name=
"com.example.android.wearable.watchface.CONFIG_DIGITAL" />
<category android:name=
"com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

As well as having the activity defined in the phone module, you need to reference it in the wear module as part of the declaration of your watch face service like this:
<service
android:name=".MyWatchFaceService" ... />
<!-- companion configuration activity -->
<meta-data
android:name=
"com.google.android.wearable.watchface.companionConfigurationAction"
android:value=
"com.my.watchface.CompanionConfigurationActivity" />
<!-- wearable configuration activity -->
<meta-data
android:name=
"com.google.android.wearable.watchface.wearableConfigurationAction"
android:value=
"com.my.watchface.WearableConfigurationActivity" />
...
Replacing com.my.watchface.CompanionConfigurationActivity and com.my.watchface.WearableConfigurationActivity with the fully qualified names of the configuration activities in the wear and phone modules respectively.

Related

Can't Understand Deep link and Intent

I want to use deep link to create a Online-Shop App. So Hear me out.
I know I have to use Intent and add <Intent-Filter><Intent-Filter/> tag in my AndroidManifest.xml file but I can't begin to understand how all of it works. There are few packages in pub.dev like flutter_branch_sdk: ^3.4.0 or receive_sharing_intent: ^1.4.5 but I'm hoping for a complete explanation or some sort of guide here. I appreciate the time you spend reading this in advance.
Here we go:
I have a app that has a Payment page. when user clicks on the Pay Now Button, He is transferred to a Safe Payment Gateway and interacts with the page. so there are 2 possible scenarios
He Succeeds in Completing the task and pays for the CARGO.
At this point Browser must Return to my app and gives me a text/message such as success and the app displays the Payment_Successful_Page
He Fails in Completing the task and pays for the CARGO
At this point Browser must Return to my app and gives me a text/message such as failure and the app displays the Payment_Failed_Page
That said If you know how it works maybe you can answer the questions below. (I have gathered the code parts from few documents and guides)
What is the <actvity><actvity/> do and what does the code below configure?
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:launchMode="singleTask"
<intent-filter>
...etc categories
</intent-filter>
</activity>
what does the <action/> do? How should I use it in app?
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<intent-filter />
how can I work with <category/> and What does the code below says?
what is the tag I should use for my scenario here?
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
how can I work with <data/> and What does the code below says?
How to get that text/message I want from the browser?
How to configure my own website where "example.com" is?
What are scheme and host here and how should it be written? (with 'http://' or without)
<data android:scheme="myapp" android:host="example.com" />
<data android:scheme="https" />
<data android:mimeType="text/plain" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="*/*" />
<data android:scheme="http" android:host="flutterbooksample.com" />
<data android:scheme="https" />

F# MySQL Type Provider, references / packages, on Linux Monodevelop

I'm moving a project (and database) from Windows and SQL Server and Visual Studio, over to Linux Mint, MySQL and MonoDevelop. I'm most of the way done--but I can't get the type provider for MySQL to work. The most obvious sticking point seems to be that:
open FSharp.Data.Sql
Gives Error, the namespace of 'Sql' is not defined. (And I don't see a NuGet package for that name.)
There's no error on any of:
open MySql.Data
open MySqlConnector
open FSharp.Data
I seem to have packages/references to:
MySqlConnector
MySql.Data
FSharp.Data
FSharp.Data.SqlClient
FSharp.Data.TypeProviders
And then I also get an error for:
SqlDataProvider
"The type 'SqlDataProvider' is not defined'".
I'm sure this is very simple, but I'm not great at which or how to use references--sorry and thanks.
(And I don't really understand how to distinguish SQLProvider from FSharp.Data.Sql provider from MySql.Data.dll from MySqlConnector.dll...)
Edits: Thanks for questions. I assume this is .Net Framework, not Core. The project originated in defaults Visual Studio templates about 3 years ago, and I've never done anything to purse Core.
For the fsproj file(s)--I'm not sure what's what. I have 4 projects in the solution (only 2 actively being used). For the project with the type provider types, this is the project.fsproj.FileListAbsolute.txt, in /obj/Debug.
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/Library3.XML
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/Library3.exe
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/Library3.pdb
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/FSharp.Core.dll
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/FSharp.Data.TypeProviders.dll
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/FSharp.Core.xml
C:/Users/gen/Desktop/Simulations/SqlFunctions/bin/Debug/FSharp.Data.TypeProviders.xml
C:/Users/gen/Desktop/Simulations/SqlFunctions/obj/Debug/Library3.exe
C:/Users/gen/Desktop/Simulations/SqlFunctions/obj/Debug/Library3.pdb
/home/gen/Downloads/Simulations 2018-07-29/SqlFunctions/bin/Debug/Library3.XML
/home/gen/Downloads/Simulations 2018-07-29/SqlFunctions/obj/Debug/SqlFunctions.fsprojResolveAssemblyReference.cache
/home/gen/Downloads/Simulations 2018-07-29/SqlFunctions/obj/Debug/Library3.exe
/home/gen/Downloads/Simulations 2018-07-29/SqlFunctions/obj/Debug/Library3.pdb
The top half of those look like old Windows references-? Obviously none of it includes anything like MySql.Data--which does appear in project/References/From Packages.
Oh wait, this at the solution level may be more relevant (I've never worked with .fsproj files):
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>397e58f9-3730-4c45-a36f-7c9f64d94f1d</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Simulations</RootNamespace>
<AssemblyName>Simulations</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>Simulations</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\Simulations.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\Simulations.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="1a.fs" />
<Compile Include="2a.fs" />
<Compile Include="2b.fs" />
<Compile Include="2c.fs" />
<Compile Include="2d.fs" />
<Compile Include="2e.fs" />
<Compile Include="2f.fs" />
<Compile Include="3a.fs" />
<Compile Include="3b.fs" />
<Compile Include="3c.fs" />
<Compile Include="3d.fs" />
<Compile Include="4a.fs" />
<Compile Include="4b.fs" />
<Compile Include="4c.fs" />
<Compile Include="5a.fs" />
<Compile Include="5b.fs" />
<Compile Include="5c.fs" />
<Compile Include="5d.fs" />
<Compile Include="5e.fs" />
<Compile Include="6a.fs" />
<Compile Include="6b.fs" />
<Compile Include="7a.fs" />
<None Include="Script.fsx" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Numerics" />
<Reference Include="FSharp.Core">
<HintPath>packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="FSharp.Data.TypeProviders">
<HintPath>packages\FSharp.Data.TypeProviders.5.0.0.6\lib\net40\FSharp.Data.TypeProviders.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple">
<HintPath>packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="SqlFunctions\SqlFunctions.fsproj">
<Name>SqlFunctions</Name>
<Project>{14eefa95-3b68-4348-a7de-db29bfb3567f}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Thanks again.
Edit 2: As I comment below--the situation has progressed (I think) to: Invalid attempt to read when Reader is closed--error on the type declaration.

Returning a custom response code for for serving static html when using IIS ApplicationInitialization remapManagedRequestsTo feature?

I'm currently using the ApplicationInitialization feature of IIS to warm up my ASP.NET application. I've set the attribute remapManagedRequestsTo to "warmup.html".
<applicationInitialization remapManagedRequestsTo="warmup.html" skipManagedModules="true" doAppInitAfterRestart="true" >
<add initializationPage="/home" />
<add initializationPage="/about-us" />
</applicationInitialization>
It's working well but I would like to return a custom status code when the content for Warmup.html is returned to the browser. This is so that when I run some smoke tests after deployment I get to know when the warm up has finished.
I've tried using URL Rewrite to change the status code from 200 to 555 to serve up warmup.html and it does change the status code but doesn't serve the content in warmup.html
<rewrite>
<rules>
<rule name="Change warm up status code" stopProcessing="true">
<match url="warmup.html" />
<action type="CustomResponse" statusCode="555" subStatusCode="0"/>
</rule>
</rules>
</rewrite>
Is there a way I can do both the serving of warmup.html's content AND return a custom status code of 555?
Finally found my answer in a blog post written by Morten Bock
Turns out I have to remove the two attributes remapManagedRequestsTo and skipManagedModules (default value of false) which leaves us with
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/home" />
<add initializationPage="/about-us" />
</applicationInitialization>
Then let the URL Rewrite module take over but we want to rewrite the response code when the Application Initialization is making the request marked by the server variable APP_WARMING_UP containing a value of 1. When this condition is met we can create a custom response as the action and pop the statusCode attribute with 555.
<rewrite>
<rules>
<rule name="WarmUp" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{APP_WARMING_UP}" pattern="1" />
</conditions>
<action type="CustomResponse" statusCode="555" statusReason="Site is warming up" statusDescription="Try again shortly" />
</rule>
</rules>
</rewrite>
Then to catch the status 555 as a custom error and direct the user to the friendly warm up page warmup.html
<system.webServer>
<httpErrors errorMode="Custom">
<error statusCode="555" path="warmup.html" responseMode="File" />
</httpErrors>
</system.webServer>

Phonegap Build + Windows phone app + "Can't install company app error"

I'm getting ""Can't install company app error " when im installing my app xap on windows 8 mobile phone. I want to build the xap through phonegap build.https://build.phonegap.com
My zip contains following file hierarcy
css
js
index.html
config.xml
ic_launcher.png
my config.xml file is
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Roadrunner</name>
<description>
Be prepared on road - Navigational app focus towards road safety
</description>
<author email="dev#cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
<plugin name="cordova-plugin-whitelist" version="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="winphone">
</platform>
</widget>
Um getting the following error.
Can't install company app error -- There is a problem with this comapny app.
Please help me out/
change your app id
<widget id="io.cordova.hellocordova"
to
<widget id="com.yourcompanydomain"

Cordova showing white screen when appis installed in 4.4.2 android version

Cordova showing white screen when app is installed in 4.4.2 android version devices and it is working fine in ios devices and 4.4.2 android version device and in 4.4.2 it was showing error in console Channel not fired: onDOMContentLoaded
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" android:windowSoftInputMode="adjustPan" package="com.Webstation.Osmosys" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/app_name" android:name="WebstationApp" android:screenOrientation="userPortrait" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>