-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download data from the Internet and parse it.
Added textviewes that showed information about source.
- Loading branch information
Showing
8 changed files
with
204 additions
and
23 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,17 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/linearLayout1"> | ||
<ImageView | ||
android:src="@android:drawable/ic_menu_gallery" | ||
android:layout_width="fill_parent" | ||
android:layout_height="180dp" | ||
android:scaleType="fitCenter" | ||
android:id="@+id/LogoImageView" /> | ||
<TextView | ||
android:text="Title" | ||
android:textAppearance="?android:attr/textAppearanceLarge" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/LogoImageView" | ||
android:id="@+id/TitleTextView" | ||
android:lines="1" /> | ||
<TextView | ||
android:text="info" | ||
android:textAppearance="?android:attr/textAppearanceSmall" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_below="@id/TitleTextView" | ||
android:id="@+id/InfoTextView" /> | ||
<Button | ||
android:id="@+id/PlayButton" | ||
android:layout_below="@id/InfoTextView" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/Play" /> | ||
<Button | ||
android:id="@+id/StopButton" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/Stop" /> | ||
</LinearLayout> | ||
android:text="@string/Stop" | ||
android:layout_below="@id/PlayButton" /> | ||
</RelativeLayout> |
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,59 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
using Android.App; | ||
using Android.Content; | ||
using Android.OS; | ||
using Android.Runtime; | ||
using Android.Views; | ||
using Android.Widget; | ||
using System.Net; | ||
|
||
namespace ListenRadio | ||
{ | ||
class StreamInfo | ||
{ | ||
/// <summary> | ||
/// Used for get stream info | ||
/// </summary> | ||
private WebClient _client; | ||
|
||
/// <summary> | ||
/// Stream info if requset complete without errors | ||
/// </summary> | ||
private string _data; | ||
public string GetData() | ||
{ | ||
return _data; | ||
} | ||
|
||
/// <summary> | ||
/// Used when server return error to user | ||
/// </summary> | ||
private string _errorString; | ||
public string GetError() | ||
{ | ||
return _errorString; | ||
} | ||
|
||
public StreamInfo(string url) | ||
{ | ||
_client = new WebClient(); | ||
_client.DownloadStringAsync(new Uri(url)); | ||
_client.DownloadStringCompleted += StreamDataGet; | ||
} | ||
|
||
private void StreamDataGet(object sender, DownloadStringCompletedEventArgs e) | ||
{ | ||
if (e.Error == null) | ||
_data = e.Result; | ||
else | ||
{ | ||
_data = null; | ||
_errorString = e.Error.Message; | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="monoandroid60" /> | ||
</packages> |