From: Kyuho Jo Date: Tue, 28 Feb 2017 10:42:42 +0000 (+0900) Subject: Storing/Restoring AppShortcutInfo X-Git-Tag: submit/tizen/20170808.015446~232 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c8ad1f510b23b111b0dbc8761dfdf020e1d8935;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Storing/Restoring AppShortcutInfo Change-Id: I Signed-off-by: Kyuho Jo --- diff --git a/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs b/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs index e2fb264..ca109c1 100644 --- a/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs +++ b/TVHome/TVHome.TizenTV/Ports/ApplicationManagerPort.cs @@ -34,7 +34,6 @@ namespace TVHome.TizenTV.Ports void OnApplicationLaunched(object sender, EventArgs args) { ApplicationLaunchedEventArgs launchedEventArgs = args as ApplicationLaunchedEventArgs; - DebuggingUtils.Dbg(launchedEventArgs.ApplicationInfo.Label.ToString() + " launched"); } @@ -53,11 +52,35 @@ namespace TVHome.TizenTV.Ports result[0] = appInfo.Label != null ? appInfo.Label : null; result[1] = appInfo.ApplicationId != null ? appInfo.ApplicationId : null; result[2] = appInfo.IconPath != null ? appInfo.IconPath : "AppIcon.png"; - resultList.Add(appInfo.ApplicationId, result); } return resultList; } + + public Dictionary GetInstalledApplication(string applicationId) + { + Dictionary result = null; + ApplicationInfo appInfo = null; + try + { + appInfo = ApplicationManager.GetInstalledApplication(applicationId); + if (appInfo == null) + { + DebuggingPort.D("GetInstalledApplication failed"); + return null; + } + result = new Dictionary(); + result.Add("Label", appInfo.Label); + result.Add("ApplicationId", appInfo.ApplicationId); + result.Add("IconPath", appInfo.IconPath); + } + catch(Exception exception) + { + DebuggingPort.E("Exception " + applicationId + " :" + exception.Message); + return null; + } + return result; + } } } \ No newline at end of file diff --git a/TVHome/TVHome.TizenTV/Ports/FileSystemPort.cs b/TVHome/TVHome.TizenTV/Ports/FileSystemPort.cs new file mode 100644 index 0000000..585e211 --- /dev/null +++ b/TVHome/TVHome.TizenTV/Ports/FileSystemPort.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.1 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO; + +using Tizen; +using Tizen.Applications; +using TVHome.Utils; + +namespace TVHome.TizenTV.Ports +{ + class FileSystemPort : IFileSystemAPIs + { + public Stream OpenFile(string filePath, UtilFileMode mode) + { + Stream fileStream = null; + DebuggingPort.D("Opening the file... " + filePath); + try + { + fileStream = new FileStream(filePath, (FileMode)mode); + DebuggingPort.D("Opened."); + } + catch (Exception exception) + { + DebuggingPort.E("Exception!! " + exception.Message); + } + return fileStream; + } + + public void Flush(Stream stream) + { + var fileStream = stream as FileStream; + fileStream.Flush(); + } + + public void CloseFile(Stream stream) + { + var fileStream = stream as FileStream; + fileStream.Dispose(); + } +} +} diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs index 0b516f1..0ba37bd 100644 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs @@ -24,7 +24,7 @@ namespace TVHome.TizenTV AppResourcePath = DirectoryInfo.Resource; AppDataPath = DirectoryInfo.Data; - DebuggingPort.D("I'm here"); + DebuggingPort.D("Home application is being loaded..."); LoadApplication(new App()); } @@ -39,6 +39,7 @@ namespace TVHome.TizenTV global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.DependencyService.Register(); + global::Xamarin.Forms.DependencyService.Register(); global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); app.Run(args); } diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj index 69739e4..bd75a01 100644 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.csproj @@ -51,6 +51,7 @@ + @@ -60,7 +61,6 @@ - @@ -68,6 +68,9 @@ TVHome + + +