From 09dbd0528957cf2c1242c579e0f6835d3389e960 Mon Sep 17 00:00:00 2001 From: Airat Date: Sat, 25 Jun 2016 02:39:43 +0300 Subject: [PATCH] Download data from the Internet and parse it. Added textviewes that showed information about source. --- ListenRadio/ListenRadio.csproj | 6 ++ ListenRadio/MainActivity.cs | 75 ++++++++++++++++++++-- ListenRadio/Resources/Resource.Designer.cs | 16 ++++- ListenRadio/Resources/layout/Main.axml | 30 +++++++-- ListenRadio/Resources/values/Strings.xml | 1 + ListenRadio/StreamInfo.cs | 59 +++++++++++++++++ ListenRadio/StreamService.cs | 36 +++++++---- ListenRadio/packages.config | 4 ++ 8 files changed, 204 insertions(+), 23 deletions(-) create mode 100644 ListenRadio/StreamInfo.cs create mode 100644 ListenRadio/packages.config diff --git a/ListenRadio/ListenRadio.csproj b/ListenRadio/ListenRadio.csproj index 51aa021..10d6856 100644 --- a/ListenRadio/ListenRadio.csproj +++ b/ListenRadio/ListenRadio.csproj @@ -43,6 +43,10 @@ + + ..\packages\Newtonsoft.Json.8.0.3\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll + True + @@ -52,10 +56,12 @@ + + diff --git a/ListenRadio/MainActivity.cs b/ListenRadio/MainActivity.cs index c6ab357..1f3a16e 100644 --- a/ListenRadio/MainActivity.cs +++ b/ListenRadio/MainActivity.cs @@ -5,13 +5,24 @@ using Android.Views; using Android.Widget; using Android.OS; +using System.Net; +using Android.Util; +using System.Threading; +using Newtonsoft.Json.Linq; +using System.Threading.Tasks; namespace ListenRadio { - [Activity(Label = "ListenRadio", MainLauncher = true, Icon = "@drawable/icon")] + [Activity(Label = "ListenRadio", MainLauncher = true, Icon = "@drawable/icon", ConfigurationChanges = Android.Content.PM.ConfigChanges.KeyboardHidden | Android.Content.PM.ConfigChanges.Keyboard | Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)] public class MainActivity : Activity { - int count = 1; + /// + /// Used for get info from Source ancestor value, if with 0 will be null, then icrease them. + /// + private int _sourcepath = 0; + + private TextView titleTextView; + private TextView infoTextView; protected override void OnCreate(Bundle bundle) { @@ -20,22 +31,76 @@ protected override void OnCreate(Bundle bundle) // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); - // Get our button from the layout resource, - // and attach an event to it Button playButton = FindViewById