This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the initial work to get Tizen started. #23
- Loading branch information
1 parent
c1169ec
commit 58b6041
Showing
33 changed files
with
638 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Xamarin.Forms.Platform.Tizen; | ||
|
||
namespace Samples.Tizen | ||
{ | ||
class Program : FormsApplication | ||
{ | ||
protected override void OnCreate() | ||
{ | ||
base.OnCreate(); | ||
|
||
LoadApplication(new App()); | ||
} | ||
|
||
static void Main(string[] args) | ||
{ | ||
var app = new Program(); | ||
Forms.Init(app); | ||
app.Run(args); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>tizen40</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugType>portable</DebugType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>None</DebugType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Tizen.NET" Version="4.0.0" ExcludeAssets="Runtime" /> | ||
<PackageReference Include="Tizen.NET.Sdk" Version="1.0.1" /> | ||
<PackageReference Include="Xamarin.Forms.Platform.Tizen" Version="2.5.0.280555" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Xamarin.Essentials\Xamarin.Essentials.csproj" /> | ||
<ProjectReference Include="..\Samples\Samples.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="lib\" /> | ||
<Folder Include="res\" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\..\CodeStyles.targets" /> | ||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.xamarin.essentials" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages"> | ||
<profile name="common" /> | ||
<ui-application appid="com.xamarin.essentials" exec="Samples.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single"> | ||
<label>Xamarin.Essentials</label> | ||
<icon>Samples.Tizen.png</icon> | ||
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" /> | ||
</ui-application> | ||
<privileges> | ||
<privilege>http://tizen.org/privilege/appmanager.launch</privilege> | ||
</privileges> | ||
<provides-appdefined-privileges /> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Accelerometer | ||
{ | ||
internal static bool IsSupported => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void PlatformStart(SensorSpeed sensorSpeed) => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void PlatformStop() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Globalization; | ||
using Tizen.Applications; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class AppInfo | ||
{ | ||
static string GetPackageName() | ||
=> Application.Current.ApplicationInfo.PackageId; | ||
|
||
static string GetName() | ||
=> Application.Current.ApplicationInfo.Label; | ||
|
||
static string GetVersionString() | ||
{ | ||
try | ||
{ | ||
var packageId = Application.Current.ApplicationInfo.PackageId; | ||
return PackageManager.GetPackage(packageId).Version; | ||
} | ||
catch | ||
{ | ||
return string.Empty; | ||
} | ||
} | ||
|
||
static string GetBuild() | ||
=> Version.Build.ToString(CultureInfo.InvariantCulture); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Battery | ||
{ | ||
static void StartBatteryListeners() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void StopBatteryListeners() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static double PlatformChargeLevel => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static BatteryState PlatformState => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static BatteryPowerSource PlatformPowerSource => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Browser | ||
{ | ||
static Task PlatformOpenAsync(Uri uri, BrowserLaunchType launchType) => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Clipboard | ||
{ | ||
static void PlatformSetText(string text) | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static bool PlatformHasText | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static Task<string> PlatformGetTextAsync() | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Compass | ||
{ | ||
internal static bool IsSupported => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
internal static void PlatformStart(SensorSpeed sensorSpeed) => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
internal static void PlatformStop() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Connectivity | ||
{ | ||
static NetworkAccess PlatformNetworkAccess => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static IEnumerable<ConnectionProfile> PlatformProfiles => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void StartListeners() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void StopListeners() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class DataTransfer | ||
{ | ||
static Task PlatformRequestAsync(ShareTextRequest request) => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class DeviceDisplay | ||
{ | ||
static ScreenMetrics GetScreenMetrics() => throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void StartScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static void StopScreenMetricsListeners() => throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Plat = Xamarin.Essentials.Platform; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class DeviceInfo | ||
{ | ||
static string GetModel() | ||
=> Plat.GetSystemInfo("model_name"); | ||
|
||
static string GetManufacturer() | ||
=> Plat.GetSystemInfo("manufacturer"); | ||
|
||
static string GetDeviceName() | ||
=> Plat.GetSystemInfo("device_name"); | ||
|
||
static string GetVersionString() | ||
=> Plat.GetFeatureInfo("platform.version"); | ||
|
||
static string GetPlatform() | ||
=> Platforms.Tizen; | ||
|
||
static string GetIdiom() | ||
{ | ||
var profile = Plat.GetFeatureInfo("profile")?.ToUpperInvariant(); | ||
|
||
if (profile == null) | ||
return Idioms.Unsupported; | ||
|
||
if (profile.StartsWith("M")) | ||
return Idioms.Phone; | ||
else if (profile.StartsWith("W")) | ||
return Idioms.Watch; | ||
else if (profile.StartsWith("T")) | ||
return Idioms.TV; | ||
else | ||
return Idioms.Unsupported; | ||
|
||
// if (profile.StartsWith("I")) | ||
// return Idioms.Car; | ||
} | ||
|
||
static DeviceType GetDeviceType() | ||
{ | ||
var arch = Plat.GetFeatureInfo("platform.core.cpu.arch"); | ||
var armv7 = Plat.GetFeatureInfo<bool>("platform.core.cpu.arch.armv7"); | ||
var x86 = Plat.GetFeatureInfo<bool>("platform.core.cpu.arch.x86"); | ||
|
||
if (arch != null && arch.Equals("armv7") && armv7 && !x86) | ||
return DeviceType.Physical; | ||
else if (arch != null && arch.Equals("x86") && !armv7 && x86) | ||
return DeviceType.Virtual; | ||
else | ||
return DeviceType.Virtual; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Email | ||
{ | ||
internal static bool IsComposeSupported => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static Task PlatformComposeAsync(EmailMessage message) => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class FileSystem | ||
{ | ||
static string PlatformCacheDirectory | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static string PlatformAppDataDirectory | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static Task<Stream> PlatformOpenAppPackageFileAsync(string filename) | ||
=> throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Xamarin.Essentials | ||
{ | ||
public static partial class Flashlight | ||
{ | ||
static Task PlatformTurnOnAsync() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
|
||
static Task PlatformTurnOffAsync() => | ||
throw new NotImplementedInReferenceAssemblyException(); | ||
} | ||
} |
Oops, something went wrong.