投稿

10月, 2017の投稿を表示しています

Deep Dive into the Quick Start of Xamarin.Forms Multiscreen

How to expand the Xamarin.Forms Phoneword to a Multiscreen App: Add a new ContentPage XAML, CallHistoryPage, as the second page. ListView of the called phone numbers are programmed in the StackLayout of the CallHistoryPage.xaml to show the numbers list in the second page. Modify App.xaml.cs as below: In multiscreen App, NavigationPage class manages the stack of Page objects. So, to show MainPage firstly after launching the App, modify “MainPage = new MainPage();” to “MainPage = new NavigationPage(new MainPage());”. To display and interact with the phone number data, some code about Data Binding are added in this file. Those are a little bit difficult to understand for me, so I will study them more deeply later. Add the OnCallHistory button to move the CallHistoryPage in the MainPage.xaml. Add some code with PushAsync method of NavigationPage class in MainPage.xaml.cs to move the CallHistoryPage when OnCallHistory button is tapped.

Deep Dive into the Quick Start of Xamarin.Forms

I have created Phoneword App of Xamarin.Forms by devotedly following the instruction of Xamarin.Forms Quickstart, and the Apps for both of iOS and Android are built simultaneously. Some points that I learned from the Deep Dive of the Phoneword (Xamarin.Forms) are shown below: Three new projects (Phoneword, Phoneword_iOS, Phoneword_Droid) are created in a new Phoneword Solution. Phoneword project has shared code and UI, and are called Portable Class Library (PCL). Reference, Packages (NuGet Package?), Properties etc. are also created in the solution. By adding a new ContentPage XAML as the name of MainPage, two new files, MainPage.xaml and MainPage.xaml.cs are created, and UI functions are programmed in the files. In the Phoneword solution, UI architecture are: Pages: ContentPage Layout: StackLayout Views: Label, Entry, Button Cells: (not used in the Phoneword solution) No need to change App.xaml. MainPage are called in App.xaml.cs, and the first page of this App are show

Free Provisioning

イメージ
I don’t know Xamarin, C# and others at all, so I don’t need to know how to test Apps on real device yet. But since it’s absolutely sure that I will want to do it in the future, I have tried Free Provisioning. Free Provisioning guide site seems not a little bit helpful, so I write down how I did it. In Xcode, added my Apple ID, and physically connected my iPhone to my Mac. Created a blank App. Product Name and Organization Identifier are important here. At this time, I created a blank App with the Product Name of “FreeProvision” and the Organization Identifier of “Xamarin”. Then, a new solution with the name of “FreeProvisioning” has been created, and its Bundle Identifier was “Xamarin.FreeProvisioning.” Selected my iPhone in simulator selection tab and built the solution, FreeProvision App was installed on my iPhone. Launched the App, but error, because my iPhone didn’t trust the App’s developer (my Apple ID). So verified the App

misc (1)

System, UIKit, Foundation etc., which are called by “using” directive in the Phoneward sample program of iOS Quick Start , can be found in Xamarin Libraries for iOS, “Xamarin.iOS.” But System.Text, for example, that is also called in the sample program is not in Xamarin.iOS, but in Base Class Library. Now, I don’t study more what BCL is. In the file folder of a solution, solution and project file have been created with name of XXX.sln and XXX.csproj respectively. By double-clicking whichever file, you can open the whole solution. But in the case that one solution has two more projects, double-clicking one of projects can not open the whole solution. In order to display iPhone keyboard in iPhone simulator when you touch inside the text-field of Phoneword sample program, unchek “Connected ???” at Hardware > Keyboard tab of iPhone simulator.

Deep Dive into the two Quick Start Apps

Picked up some things from the Deep Dive of the first App, Phoneword_iOS(single screen) : The basic structure of the whole solution: Solution > Project1, Project2, - - - In a project, there are some files such as Main.cs, Main.storyboard, AppDelegates.cs ViewController.cs etc. The basic architecture: Main - AppDelegate - View UI keywords: View/Subview, Content View Hierarchy, ViewController etc. Subviews have some properties, and they are defined in Properties Pad and Document Online Pad. Segue shown as a gray arrow in storyboards represents screen transition. View Life Cycle: ViewDidLoad starts the cycle. ViewWillAppear/Disappear, ViewDidAppear/Disappear are also useful in some Apps. Some Events such as TouchUpInside are called in this App, and the events seem to be defined in UIKit class. Some control methods for Button: how to change button name, how to enable/disable button. How to dismiss keyboard on simulator after text input (ResignFirstResponder()). How to set B

Quick Start

Actually, I don’t know Xamarin and C# at all, I have no books about them, but I tried to play with the sample program in the page of iOS QuickStart . I have completely followed the instruction, and  an App to translate a phone number in alphabet to the numerical one was built without any problems. Multi Screen sample program is also available, and the above App  was successfully expanded to have the second screen where call histories were listed. Although I have not understood C# source code yet, I could faintly touch pretty much simple App development work such as UI design, mapping between objects and C# source code, screen transition and so on. Next, I will read detailed explanation (Deep Dive) about the two Apps developments above.

Install Xamarin

イメージ
To use Xamarin on my Mac, visited its store site  and  installed Visual Studio for Mac.  Three applications (Visual Studio, Xamarin Profiler, Xamarin Workbooks) were installed, and moved all of them into one group with the name of Xamarin. Although I don’t know what Profiler and Workbooks are, I launched Visual Studio. Since I’m a beginner, I humbly read the three introduction topics on the left side of the window. The first one was the release note. I looked over " Introducing Visual Studio for Mac "  linked in the note. Both of C# and F# can be used as programming language, and C# seems to be more popular than F#, so I’d better study C# initially. Unity seems to be supported for game programming, but now, no matter to me. The second one was introduction of .NET. I couldn’t understand it well, so skip. Clicked the last one, “ ->  Learn about Mobile Development with Xamarin ,” I could see some words such as “Getting Started” and “Build your first App.” It se

Which development platform should I use?

Since I’m an iPhone user, it’s definitely required to be able to develop iOS Apps, but better to build also Android's ones. So I need to choose one of Cross Platform Environments. Although Unity, Monaca etc. seem to be famous as a Cross Platform Environment, I have intuitively chosen Xamarin as my first development platform. Xcode with Swift was also attractive to me, because my PC is Mac. But I probably have to develop Apps on also Windows, and Xcode is a little annoying to run on the OS, so it was turned down this time. BTW, A little uneasy about Xamarin. No doubt that native Apps can be developed on it, but how about hybrid Apps? I couldn’t find any articles saying that Xamarin can do it. Razor Templates (?) seems to be able to make it possible…? Well, I don’t worry too much now, I will just start it anyway.

Open this Blog

To write my fight with programming, I opened a blog site firstly in my life. So, which blog service is the best for me? I'm a beginner. I don't know if I will be able to keep writing for a long time. Any service is fine, if it's free. But, since some services are being compared in terms of price, data capacity, ad display, affiliate etc., I have thought about it: FC2: Ads are forcibly displayed in a noticeable position. Abema, Hatena, Jugem: I don' like the names. livedoor: I don't like it, b/c it had some troubles before. goo, Yahoo, exite: Low spec for customization etc. After more survey, I found some services which is famous overseas. WordPress, Tumblr, Blogger, live journal, blog.com etc. I have not studied them in detail, but WordPress with good customization and Blogger with high spec seem to be good for me. Then, I opened two blogs! I will post same articles to both of them, but in English in this blog, in Japanese in WordPress.