├── .gitignore
├── Droid
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-xhdpi
│ │ └── icon.png
│ ├── drawable-xxhdpi
│ │ └── icon.png
│ ├── drawable
│ │ └── icon.png
│ ├── layout
│ │ ├── Tabbar.axml
│ │ └── Toolbar.axml
│ └── values
│ │ └── styles.xml
├── SimpleList.Droid.csproj
└── packages.config
├── README.md
├── SimpleList.sln
├── SimpleList
├── App.xaml
├── App.xaml.cs
├── Properties
│ └── AssemblyInfo.cs
├── SimpleList.csproj
├── SimpleListPage.xaml
├── SimpleListPage.xaml.cs
├── Speaker.cs
└── packages.config
├── documents
└── image
│ ├── add_nuget.jpg
│ ├── create_new_project.png
│ ├── create_new_xamarin_forms_project.jpg
│ ├── create_new_xamarin_project.png
│ ├── finished.png
│ └── nuget_package_manager.jpg
└── iOS
├── AppDelegate.cs
├── Assets.xcassets
├── AppIcon.appiconset
│ └── Contents.json
└── Contents.json
├── Entitlements.plist
├── Info.plist
├── LaunchScreen.storyboard
├── Main.cs
├── SimpleList.iOS.csproj
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | # Autosave files
2 | *~
3 |
4 | # build
5 | [Oo]bj/
6 | [Bb]in/
7 | packages/
8 | TestResults/
9 |
10 | # globs
11 | Makefile.in
12 | *.DS_Store
13 | *.sln.cache
14 | *.suo
15 | *.cache
16 | *.pidb
17 | *.userprefs
18 | *.usertasks
19 | config.log
20 | config.make
21 | config.status
22 | aclocal.m4
23 | install-sh
24 | autom4te.cache/
25 | *.user
26 | *.tar.gz
27 | tarballs/
28 | test-results/
29 | Thumbs.db
30 |
31 | # Mac bundle stuff
32 | *.dmg
33 | *.app
34 |
35 | # resharper
36 | *_Resharper.*
37 | *.Resharper
38 |
39 | # dotCover
40 | *.dotCover
41 |
--------------------------------------------------------------------------------
/Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content;
5 | using Android.Content.PM;
6 | using Android.Runtime;
7 | using Android.Views;
8 | using Android.Widget;
9 | using Android.OS;
10 |
11 | namespace SimpleList.Droid
12 | {
13 | [Activity(Label = "SimpleList.Droid", Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
14 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
15 | {
16 | protected override void OnCreate(Bundle bundle)
17 | {
18 | TabLayoutResource = Resource.Layout.Tabbar;
19 | ToolbarResource = Resource.Layout.Toolbar;
20 |
21 | base.OnCreate(bundle);
22 |
23 | global::Xamarin.Forms.Forms.Init(this, bundle);
24 |
25 | LoadApplication(new App());
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
9 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("SimpleList.Droid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("(c) Madoka Chiyoda")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
--------------------------------------------------------------------------------
/Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/Droid/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/Droid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
35 |
41 |
42 |
--------------------------------------------------------------------------------
/Droid/SimpleList.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | SimpleList.Droid
10 | SimpleList.Droid
11 | v7.1
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 | true
19 |
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug
26 | DEBUG;
27 | prompt
28 | 4
29 | None
30 |
31 |
32 | true
33 | pdbonly
34 | true
35 | bin\Release
36 | prompt
37 | 4
38 | true
39 | false
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | ..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
48 |
49 |
50 | ..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
51 |
52 |
53 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
54 |
55 |
56 | ..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
57 |
58 |
59 | ..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
60 |
61 |
62 | ..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
63 |
64 |
65 | ..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
66 |
67 |
68 | ..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll
69 |
70 |
71 | ..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\FormsViewGroup.dll
72 |
73 |
74 | ..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Core.dll
75 |
76 |
77 | ..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
78 |
79 |
80 | ..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
81 |
82 |
83 | ..\packages\Xamarin.Forms.2.3.3.180\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
84 |
85 |
86 | ..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll
87 |
88 |
89 |
90 |
91 | {029FFDAB-699A-4A08-B19C-611D5472A38A}
92 | SimpleList
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/Droid/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple List App
2 |
3 | Xamarin ハンズオン用の、簡単なアプリ制作の手順書です。
4 |
5 | JSON を引っ張ってきて、それをリストビューに表示させる、簡単なアプリです。
6 |
7 | ## 開発環境
8 |
9 | Windows でも Mac でも良いです。
10 |
11 | |OS|OS のバージョン|要インストール済|
12 | |----|----|----|
13 | |Windows|Windows 10|Xamarin インストール済みの Visual Studio 2017|
14 | |Mac OS X|10.11 ("El Capitan") 以降 |Visual Studio for Mac と 最新の Xcode |
15 |
16 |
17 | ## 完成形
18 |
19 | 
20 |
21 | 使うサンプルJSONは[こちら](http://demo4404797.mockable.io/speakers)です。(本社の Xamarin チームの
22 |
23 | ```js
24 | [
25 | {
26 | "Name": "Matthew Soucoup",
27 | "Description": "Matthew is a Xamarin MVP and Certified Xamarin Developer from Madison, WI. He founded his company Code Mill Technologies and started the Madison Mobile .Net Developers Group. Matt regularly speaks on .Net and Xamarin development at user groups, code camps and conferences throughout the Midwest. Matt gardens hot peppers, rides bikes, and loves Wisconsin micro-brews and cheese.",
28 | "Image": "http://i.imgur.com/y4dzyT3.jpg",
29 | "Title": "Architect",
30 | "Company": "Code Mill Technologies",
31 | "Website": "https://codemilltech.com",
32 | "Blog": "https://codemilltech.com/",
33 | "Twitter": "codemillmatt",
34 | "Email": "MSoucoup@newco.com",
35 | "Avatar": "http://i.imgur.com/RTDt4nb.jpg"
36 | },
37 | {
38 | "Name": "James Montemagno",
39 | "Description": "James is a Principal Program Manager at Xamarin",
40 | "Image": "https://blogs.office.com/wp-content/uploads/2015/04/JamesM.jpg",
41 | "Title": "Principal PM",
42 | "Company": "Microsoft",
43 | "Website": "https://motzcod.es",
44 | "Blog": "https://motzcod.es/",
45 | "Twitter": "jamesmontemagno",
46 | "Email": "MSoucoup@newco.com",
47 | "Avatar": "https://blogs.office.com/wp-content/uploads/2015/04/JamesM.jpg"
48 | },
49 | {
50 | "Name": "Star Simpson",
51 | "Description": "A robot-builder from an early age, Star has explored robotics and automation in electronics and software from MIT to Shenzhen. She previously worked on some of the first robots to demonstrate human emotional expressiveness in Cynthia Brezeal’s personal robotics lab. Her interest carried her into the aerial robotics world, exploring drone-based delivery through TacoCopter many years ahead of anyone else. Now residing in SF, she’s looking for ways that tech can advance and extend human capability.",
52 | "Image": "http://i.imgur.com/mqRwv84.jpg",
53 | "Title": "Consultant",
54 | "Company": "",
55 | "Website": "N/A",
56 | "Blog": "N/A",
57 | "Twitter": "starsandrobots",
58 | "Email": "SSimpson@newco.com",
59 | "Avatar": "http://i.imgur.com/BlC5zlJ.jpg"
60 | },
61 | (略)
62 | ]
63 | ```
64 |
65 | ## 「新規作成」
66 |
67 | `Xamarin.Forms` アプリの「新規作成」をしましょう。
68 |
69 | * Xamarin.Forms
70 | * 共通部分は PCL
71 | * アプリの名前は何でもいい。私は "`SimpleList`"にした。同じにしておくとコピペが楽かも?(`namespace`がアプリ名になるので)
72 |
73 | Visual Studio for Windows の場合、
74 |
75 | 「ファイル」→「新規作成」→「プロジェクト」
76 |
77 | 
78 |
79 | テンプレートの中から Xamarin のものを選びます。
80 | 「Visual C#」→「Cross Platform」→「Cross Platform App」→(プロジェクト名編集)→「OK」
81 |
82 | 
83 |
84 | 以下のように選んで「OK」
85 |
86 | 
87 |
88 |
89 |
90 | `Visual Studio for Mac` での「新規プロジェクト作成」の方法は [こちら](https://blogs.msdn.microsoft.com/chomado/xamarin/tried-creating-an-app-using-visual-studio-for-mac/)から。
91 |
92 |
93 |
94 | ## Speakerクラスを作る(新しいファイル)
95 |
96 | 共通部分のプロジェクト名を右クリック「追加」「新しいファイル」
97 |
98 | クラス名は「Speaker」にして作成。新しいファイル`Speaker.cs`が生える。
99 |
100 | 今こんな感じ:
101 |
102 | ```csharp
103 | using System;
104 | namespace SimpleList
105 | {
106 | public class Speaker
107 | {
108 | public Speaker()
109 | {
110 | }
111 | }
112 | }
113 | ```
114 |
115 | これに新しいプロパティを生やす。
116 | こうする:
117 |
118 |
119 | ```csharp
120 | using System;
121 | namespace SimpleList
122 | {
123 | public class Speaker
124 | {
125 | public Speaker()
126 | {
127 | }
128 | // プロパティ群
129 | public string Id { get; set; }
130 | public string Name { get; set; }
131 | public string Description { get; set; }
132 | public string Website { get; set; }
133 | public string Title { get; set; }
134 | public string Avatar { get; set; }
135 | }
136 | }
137 | ```
138 |
139 | ## 見た目の作成(画面)
140 |
141 | `SimpleListPage.xaml` (もしくは `MainPage.xaml`)を開きます。これは見た目を定義しているファイルです。
142 | XAML (ざむる) とは、Micorosft による、主にUIを書くために用いられるマークアップ言語です。(XMLベースの言語)
143 |
144 | `SimpleListPage.xaml`は、最初はこうなっています。
145 |
146 | ```xml
147 |
148 |
153 |
157 |
158 | ```
159 |
160 | この `ContentPage` の中を書き換えて行きましょう。まず `Label` を消して、代わりに次のコードを差し込みます。
161 |
162 | ```xml
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
176 |
177 |
178 |
179 |
180 | ```
181 |
182 | [参照](https://github.com/chomado/SimpleList/commit/1bcca73fb5158f954164b1738c2a518a0b29af05#diff-38d51864885559ed06aa5de8960947a9)
183 |
184 |
185 | ## JSON.NET パッケージを追加
186 |
187 | JSONの扱いがめっちゃ楽になる超便利パッケージを入れましょう。
188 |
189 | C# の場合は NuGet と呼ばれるパッケージマネージャを使います。
190 |
191 | ソリューションを右クリックして「ソリューションの NuGet パッケージの管理」をクリック
192 |
193 | 
194 |
195 | NuGet パッケージマネージャが開くので、`JSON.NET` (`Newtonsoft.Json`)をクリックし、全てのプロジェクトを選択し「インストール」を押します。
196 |
197 | 
198 |
199 | これで JSON.NET が入りました。
200 |
201 | (Mac の場合はソリューションでの一括パッケージ管理ができないので、プロジェクトごとにひとつひとつ入れていってください)
202 |
203 | ## "データを読み込む"ボタンが押された時の処理(イベント)
204 |
205 | `SimpleListPage.xaml.cs` を開きます。(`SimpleListPage.xaml` のコードビハインドです。)
206 |
207 | 最初はこうなっています。
208 |
209 | ```csharp
210 | using Xamarin.Forms;
211 |
212 | namespace SimpleList
213 | {
214 | public partial class SimpleListPage : ContentPage
215 | {
216 | public SimpleListPage()
217 | {
218 | InitializeComponent();
219 | }
220 | }
221 | }
222 | ```
223 |
224 | ここに、「データを読み込む」ボタンが押された時の処理を書きます。
225 | 読み込むボタンが押されたら [こちらのJSON](http://demo4404797.mockable.io/speakers)を引っ張ってきて、よしなに表示させたいですよね。
226 |
227 | まず、必要な using 句を追加します。
228 |
229 | ```csharp
230 | using System;
231 | using System.Collections.Generic;
232 | using System.Net.Http;
233 | using Newtonsoft.Json;
234 | ```
235 |
236 | そして、コンストラクタの直後あたりに、次のコードを付け足してください。
237 |
238 | ```csharp
239 | // "データを読み込む"ボタンが押された時の処理(イベント)
240 | private async void OnClick(object sender, EventArgs e)
241 | {
242 | // HttpClient が不要になったら解放されるようにしている。(using というのは、解放しなければならないリソースを自動で解放してくれる構文)
243 | using (var client = new HttpClient())
244 | {
245 | var jsonUrl = "http://demo4404797.mockable.io/speakers";
246 |
247 | //サーバーから json を取得します
248 | var json = await client.GetStringAsync(jsonUrl);
249 |
250 | //json をデシリアライズします
251 | var items = JsonConvert.DeserializeObject>(json);
252 |
253 | // ListView に データを設定している
254 | this.speakerListView.ItemsSource = items;
255 | }
256 | }
257 | ```
258 |
259 | そして、ボタンが押された時にこの `OnClick` が呼ばれるように、XAML側に Clicked イベント呼び出しを書いておきましょう。
260 |
261 | 現在こうなっています:
262 | ```xml
263 |
264 | ```
265 |
266 | こうしてください:
267 | ```xml
268 |
269 | ```
270 |
271 |
272 | [参考](https://github.com/chomado/SimpleList/commit/924ae671e78d170cb20a322ad222c2a992ad76a0)
273 |
274 | で、「実行」してみてください。完成です
275 |
--------------------------------------------------------------------------------
/SimpleList.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleList", "SimpleList\SimpleList.csproj", "{029FFDAB-699A-4A08-B19C-611D5472A38A}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleList.iOS", "iOS\SimpleList.iOS.csproj", "{215F9188-8881-4C35-B80D-4B12BB420E37}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleList.Droid", "Droid\SimpleList.Droid.csproj", "{C83FE197-7D84-434C-92DC-BA79DEE2F686}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
15 | Release|iPhone = Release|iPhone
16 | Release|iPhoneSimulator = Release|iPhoneSimulator
17 | Debug|iPhone = Debug|iPhone
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
25 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
26 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|iPhone.ActiveCfg = Release|Any CPU
27 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|iPhone.Build.0 = Release|Any CPU
28 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
29 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
30 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|iPhone.ActiveCfg = Debug|Any CPU
31 | {029FFDAB-699A-4A08-B19C-611D5472A38A}.Debug|iPhone.Build.0 = Debug|Any CPU
32 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
33 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
34 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|Any CPU.ActiveCfg = Release|iPhone
35 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|Any CPU.Build.0 = Release|iPhone
36 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
37 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
38 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|iPhone.ActiveCfg = Release|iPhone
39 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|iPhone.Build.0 = Release|iPhone
40 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
41 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
42 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|iPhone.ActiveCfg = Debug|iPhone
43 | {215F9188-8881-4C35-B80D-4B12BB420E37}.Debug|iPhone.Build.0 = Debug|iPhone
44 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|Any CPU.Build.0 = Release|Any CPU
48 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
49 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
50 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|iPhone.ActiveCfg = Release|Any CPU
51 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|iPhone.Build.0 = Release|Any CPU
52 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
53 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
54 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|iPhone.ActiveCfg = Debug|Any CPU
55 | {C83FE197-7D84-434C-92DC-BA79DEE2F686}.Debug|iPhone.Build.0 = Debug|Any CPU
56 | EndGlobalSection
57 | EndGlobal
58 |
--------------------------------------------------------------------------------
/SimpleList/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/SimpleList/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 |
3 | namespace SimpleList
4 | {
5 | public partial class App : Application
6 | {
7 | public App()
8 | {
9 | InitializeComponent();
10 |
11 | MainPage = new SimpleListPage();
12 | }
13 |
14 | protected override void OnStart()
15 | {
16 | // Handle when your app starts
17 | }
18 |
19 | protected override void OnSleep()
20 | {
21 | // Handle when your app sleeps
22 | }
23 |
24 | protected override void OnResume()
25 | {
26 | // Handle when your app resumes
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SimpleList/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("SimpleList")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("(c) Madoka Chiyoda")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
--------------------------------------------------------------------------------
/SimpleList/SimpleList.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {029FFDAB-699A-4A08-B19C-611D5472A38A}
7 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | true
9 | Library
10 | SimpleList
11 | SimpleList
12 | v4.5
13 | Profile111
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug
20 | DEBUG;
21 | prompt
22 | 4
23 |
24 |
25 | true
26 | bin\Release
27 | prompt
28 | 4
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | App.xaml
37 |
38 |
39 | SimpleListPage.xaml
40 |
41 |
42 |
43 |
44 |
45 |
46 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll
47 |
48 |
49 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Platform.dll
50 |
51 |
52 | ..\packages\Xamarin.Forms.2.3.3.180\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll
53 |
54 |
55 | ..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/SimpleList/SimpleListPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SimpleList/SimpleListPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Net.Http;
4 | using Newtonsoft.Json;
5 | using Xamarin.Forms;
6 |
7 | namespace SimpleList
8 | {
9 | public partial class SimpleListPage : ContentPage
10 | {
11 | public SimpleListPage()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | // "データを読み込む"ボタンが押された時の処理(イベント)
17 | private async void OnClick(object sender, EventArgs e)
18 | {
19 | using (var client = new HttpClient())
20 | {
21 | //サーバーから json を取得します
22 | var json = await client.GetStringAsync("http://demo4404797.mockable.io/speakers");
23 |
24 | //json をデシリアライズします
25 | var items = JsonConvert.DeserializeObject>(json);
26 |
27 | this.speakerListView.ItemsSource = items;
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/SimpleList/Speaker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | namespace SimpleList
3 | {
4 | public class Speaker
5 | {
6 | public Speaker()
7 | {
8 | }
9 |
10 |
11 | public string Id { get; set; }
12 | public string Name { get; set; }
13 | public string Description { get; set; }
14 | public string Website { get; set; }
15 | public string Title { get; set; }
16 | public string Avatar { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SimpleList/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/documents/image/add_nuget.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/add_nuget.jpg
--------------------------------------------------------------------------------
/documents/image/create_new_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/create_new_project.png
--------------------------------------------------------------------------------
/documents/image/create_new_xamarin_forms_project.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/create_new_xamarin_forms_project.jpg
--------------------------------------------------------------------------------
/documents/image/create_new_xamarin_project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/create_new_xamarin_project.png
--------------------------------------------------------------------------------
/documents/image/finished.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/finished.png
--------------------------------------------------------------------------------
/documents/image/nuget_package_manager.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chomado/SimpleList/ed9e4b94ebc6ea6ae040d7ce1ffad225b4fdde7e/documents/image/nuget_package_manager.jpg
--------------------------------------------------------------------------------
/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace SimpleList.iOS
9 | {
10 | [Register("AppDelegate")]
11 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
12 | {
13 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
14 | {
15 | global::Xamarin.Forms.Forms.Init();
16 |
17 | LoadApplication(new App());
18 |
19 | return base.FinishedLaunching(app, options);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "idiom": "iphone",
5 | "size": "29x29",
6 | "scale": "1x"
7 | },
8 | {
9 | "idiom": "iphone",
10 | "size": "29x29",
11 | "scale": "2x"
12 | },
13 | {
14 | "idiom": "iphone",
15 | "size": "29x29",
16 | "scale": "3x"
17 | },
18 | {
19 | "idiom": "iphone",
20 | "size": "40x40",
21 | "scale": "2x"
22 | },
23 | {
24 | "idiom": "iphone",
25 | "size": "40x40",
26 | "scale": "3x"
27 | },
28 | {
29 | "idiom": "iphone",
30 | "size": "57x57",
31 | "scale": "1x"
32 | },
33 | {
34 | "idiom": "iphone",
35 | "size": "57x57",
36 | "scale": "2x"
37 | },
38 | {
39 | "idiom": "iphone",
40 | "size": "60x60",
41 | "scale": "2x"
42 | },
43 | {
44 | "idiom": "iphone",
45 | "size": "60x60",
46 | "scale": "3x"
47 | },
48 | {
49 | "idiom": "ipad",
50 | "size": "29x29",
51 | "scale": "1x"
52 | },
53 | {
54 | "idiom": "ipad",
55 | "size": "29x29",
56 | "scale": "2x"
57 | },
58 | {
59 | "idiom": "ipad",
60 | "size": "40x40",
61 | "scale": "1x"
62 | },
63 | {
64 | "idiom": "ipad",
65 | "size": "40x40",
66 | "scale": "2x"
67 | },
68 | {
69 | "idiom": "ipad",
70 | "size": "50x50",
71 | "scale": "1x"
72 | },
73 | {
74 | "idiom": "ipad",
75 | "size": "50x50",
76 | "scale": "2x"
77 | },
78 | {
79 | "idiom": "ipad",
80 | "size": "72x72",
81 | "scale": "1x"
82 | },
83 | {
84 | "idiom": "ipad",
85 | "size": "72x72",
86 | "scale": "2x"
87 | },
88 | {
89 | "idiom": "ipad",
90 | "size": "76x76",
91 | "scale": "1x"
92 | },
93 | {
94 | "idiom": "ipad",
95 | "size": "76x76",
96 | "scale": "2x"
97 | },
98 | {
99 | "size": "24x24",
100 | "idiom": "watch",
101 | "scale": "2x",
102 | "role": "notificationCenter",
103 | "subtype": "38mm"
104 | },
105 | {
106 | "size": "27.5x27.5",
107 | "idiom": "watch",
108 | "scale": "2x",
109 | "role": "notificationCenter",
110 | "subtype": "42mm"
111 | },
112 | {
113 | "size": "29x29",
114 | "idiom": "watch",
115 | "role": "companionSettings",
116 | "scale": "2x"
117 | },
118 | {
119 | "size": "29x29",
120 | "idiom": "watch",
121 | "role": "companionSettings",
122 | "scale": "3x"
123 | },
124 | {
125 | "size": "40x40",
126 | "idiom": "watch",
127 | "scale": "2x",
128 | "role": "appLauncher",
129 | "subtype": "38mm"
130 | },
131 | {
132 | "size": "44x44",
133 | "idiom": "watch",
134 | "scale": "2x",
135 | "role": "longLook",
136 | "subtype": "42mm"
137 | },
138 | {
139 | "size": "86x86",
140 | "idiom": "watch",
141 | "scale": "2x",
142 | "role": "quickLook",
143 | "subtype": "38mm"
144 | },
145 | {
146 | "size": "98x98",
147 | "idiom": "watch",
148 | "scale": "2x",
149 | "role": "quickLook",
150 | "subtype": "42mm"
151 | }
152 | ],
153 | "info": {
154 | "version": 1,
155 | "author": "xcode"
156 | }
157 | }
--------------------------------------------------------------------------------
/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | SimpleList
7 | CFBundleName
8 | SimpleList
9 | CFBundleIdentifier
10 | com.chomado.simplelist
11 | CFBundleShortVersionString
12 | 1.0
13 | CFBundleVersion
14 | 1.0
15 | LSRequiresIPhoneOS
16 |
17 | MinimumOSVersion
18 | 8.0
19 | UIDeviceFamily
20 |
21 | 1
22 | 2
23 |
24 | UILaunchStoryboardName
25 | LaunchScreen
26 | UIRequiredDeviceCapabilities
27 |
28 | armv7
29 |
30 | UISupportedInterfaceOrientations
31 |
32 | UIInterfaceOrientationPortrait
33 | UIInterfaceOrientationLandscapeLeft
34 | UIInterfaceOrientationLandscapeRight
35 |
36 | UISupportedInterfaceOrientations~ipad
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationPortraitUpsideDown
40 | UIInterfaceOrientationLandscapeLeft
41 | UIInterfaceOrientationLandscapeRight
42 |
43 | XSAppIconAssets
44 | Assets.xcassets/AppIcon.appiconset
45 |
46 |
47 |
--------------------------------------------------------------------------------
/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
16 |
19 |
20 |
21 |
22 |
24 |
25 |
28 |
29 |
32 |
35 |
36 |
40 |
46 |
50 |
56 |
57 |
58 |
63 |
64 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace SimpleList.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/iOS/SimpleList.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | {215F9188-8881-4C35-B80D-4B12BB420E37}
7 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Exe
9 | SimpleList.iOS
10 | SimpleList.iOS
11 | Resources
12 |
13 |
14 | true
15 | full
16 | false
17 | bin\iPhoneSimulator\Debug
18 | DEBUG;ENABLE_TEST_CLOUD;
19 | prompt
20 | 4
21 | iPhone Developer
22 | true
23 | true
24 | true
25 | true
26 | true
27 | true
28 | 25643
29 | None
30 | i386, x86_64
31 | HttpClientHandler
32 | x86
33 |
34 |
35 | pdbonly
36 | true
37 | bin\iPhone\Release
38 | prompt
39 | 4
40 | iPhone Developer
41 | true
42 | true
43 | true
44 | Entitlements.plist
45 | SdkOnly
46 | ARMv7, ARM64
47 | HttpClientHandler
48 | x86
49 |
50 |
51 | pdbonly
52 | true
53 | bin\iPhoneSimulator\Release
54 | prompt
55 | 4
56 | iPhone Developer
57 | true
58 | true
59 | true
60 | None
61 | i386, x86_64
62 | HttpClientHandler
63 | x86
64 |
65 |
66 | true
67 | full
68 | false
69 | bin\iPhone\Debug
70 | DEBUG;ENABLE_TEST_CLOUD;
71 | prompt
72 | 4
73 | iPhone Developer
74 | true
75 | true
76 | true
77 | true
78 | true
79 | true
80 | true
81 | Entitlements.plist
82 | SdkOnly
83 | ARMv7, ARM64
84 | HttpClientHandler
85 | x86
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 | ..\packages\Xamarin.Forms.2.3.3.180\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
94 |
95 |
96 | ..\packages\Xamarin.Forms.2.3.3.180\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
97 |
98 |
99 | ..\packages\Xamarin.Forms.2.3.3.180\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
100 |
101 |
102 | ..\packages\Xamarin.Forms.2.3.3.180\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
103 |
104 |
105 | ..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll
106 |
107 |
108 |
109 |
110 | {029FFDAB-699A-4A08-B19C-611D5472A38A}
111 | SimpleList
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
--------------------------------------------------------------------------------
/iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------