Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Windows Azure > Windows Azure Mobile Services > ตอนที่ 2 : สร้าง Mobile Services บน Windows Azure และการเชื่อมต่อเพื่อเรียกใช้งาน



Clound SSD Virtual Server

ตอนที่ 2 : สร้าง Mobile Services บน Windows Azure และการเชื่อมต่อเพื่อเรียกใช้งาน

ตอนที่ 2 : การสร้าง Mobile Services บน Windows Azure และการเชื่อมต่อเพื่อเรียกใช้งาน ก่อนหน้านี้ในบทความแรกเราได้รู้จักกับ Windows Azure Mobile Services ว่ามันคืออะไร และมีประโยชน์อย่างไร ในบทความนี้จะมาเริ่มต้นการใช้งาน Mobile Services บน Windows Azure ด้วยการทำความเข้าใจกับรูปแบบการทำงานคร่าว ๆ ของส่วนประกอบของ Mobile Services ที่จัดการด้วย Portal Management รวมทั้งการสร้าง Mobile Services แรก วิธีการเชื่อมต่อ และรายละเอียดอื่น ๆ ที่เกี่ยวข้องกับ Mobile Services บน Windows Azure

Windows Azure Mobile Services Start Up

ในหน้าจอ Portal Management บน Windows Azure จะมี Mobile Services ซึ่งในขณะนี้มี 0 รายการ

Windows Azure Mobile Services Start Up

ต้องการสร้าง Mobile Services ให้คลิกที่ CREATE A NEW MOBILE SERVICE

Windows Azure Mobile Services Start Up

หรือจะคลิกที่ NEW

Windows Azure Mobile Services Start Up

เลือก NEW -> COMPUTE -> MOBILE SERVICE -> CREATE

Windows Azure Mobile Services Start Up

ใน Mobile Services การเรียกใช้งานจะเรียกใช้ผ่าน URL ซึ่งจะอยู่ภายใต้ Subdomain ว่า .azure-mobile.net








ให้เรากรอก URL ของเรา และเลือก Create a new SQL database instance

Windows Azure Mobile Services Start Up

กรอกชื่อ Database เลือก New SQL database server และข้อมูลอื่น ๆ เช่น Login Name / Password และ Region ที่ต้องการ

Windows Azure Mobile Services Start Up

หลังจากนั้นเราจะได้ Mobile Services ขึ้นมา 1 รายการ ให้คลิกเข้าไปในหน้าหลัก

Windows Azure Mobile Services Start Up

ในหน้าหลักของ Mobile Services จะแสดง Platform ที่ Mobile Services รองรับในปัจจุบัน หลัก ๆ เช่น Android , iOS และ Windows Phone และอื่น ๆ เช่น Windows Store และ HTML/JavaScript

รวมทั้ง Get Started ซึ่งจะให้คำแนะนำเกี่ยวกับการเชื่อมต่อและเรียกใช้งาน Mobile Services ที่เราสร้างขึ้น

Windows Azure Mobile Services Start Up

ในส่วนถัดไปจะเป็นหน้า Dashboard จะเป็นรายละเอียดของ Mobile Services ที่เราสร้างชึ้น เช่น Service URL และรายละเอียดอื่น ๆ ที่เกี่ยวข้องทั้งหมดของ Mobile Services

Windows Azure Mobile Services Start Up

เมนู Data จะเป็นรายการ Table และ Data ข้อมูลที่ถูกเก็บเก็บไว้ใน Service นี้ ซึ่งมุมมองจะเป็นแบบ Table เหมือนกับ SQL Database ทั่ว ๆ ไป

Windows Azure Mobile Services Start Up

ในกรณีมี Table ก็จะแสดงรายการ Table ออกมาทั้งหมด รวมทั้งรายการ Record ของ Table นั้น ๆ

Windows Azure Mobile Services Start Up

รายการข้อมูลใน Table ซึ่งแบ่งออกเป็น Column และ Rows

Windows Azure Mobile Services Start Up

นอกจากนี้ยังมีเมนูอื่น ๆ ไว้จัดการพวก Schedule , Push และอื่น ๆ ซึ่งอาจจะได้พูดถึงในหัวข้อถัด ๆ ไป

Windows Azure Mobile Service Start Up

กลับมายังหน้าหลักของ Mobile Services บน Windows Azure ให้คลิกที่ Platform สำหรับ Android และเลือกในส่วนของ Get Started ซึ่งจะประกอบด้วย 2 ประเภทหลัก ๆ คือ








1. Create a new Android App (ในกรณีที่เราไม่มี Project ของ Android แต่ต้องการที่จะดาวน์โหลดเพื่อสร้าง Project ใหม่)

Windows Azure Mobile Services Start Up

เลือก Create a new Android App (ใช้ในกรณีที่เราจะสร้าง App ขึ้นมาใหม่ ซึ่งจะมีตัวอย่างให้เราดาวน์โหลดไปทดสอบได้ทันที) โดยการใช้ Mobile Services กับ Android จะต้องใช้กับ Android รุ่น 4.2 (API 17) เป็นต้นไป นอกจากนี้ยังสามารถทดสอบการสร้างตาราง (Table) และดาวน์โหลด Code เพื่อไปทดสอบดู

Windows Azure Mobile Services Start Up

ในกรณีที่ดาวน์โหลดมาแล้วจะได้เป็นไฟล์ zip

Windows Azure Mobile Services Start Up\

เมื่อแตกไฟล์ zip จะเห็นว่าเป็น Project ที่นำไปใช้งานสำหรับการเขียน Android บน Eclispe ได้ในทันที

Windows Azure Mobile Services Start Up

ใน Eclispe จะใช้การ Import เข้าไปใน Project เพื่อสร้าง Project ใหม่

Windows Azure Mobile Services Start Up

หน้าจอบนโปรแกรม Eclipse

Windows Azure Mobile Services Start Up

ทดสอบการรันโปรแกรมบน Emulator จะได้ผลลัพธ์ดังรูป ซึ่งเราสามารถที่จะทดสอบการเพิ่มข้อมูลบน Emulator และข้อมูลก็จะถูกจัดเก็บไว้บน Windows Azure Mobile Services


2. Conenct an existing Android App (ในกรณีที่เรามี Project อยู่แล้ว ต้องการที่จะเขียนติดต่อกับ Mobile Services)

Windows Azure Mobile Services Start Up

ในขั้นแรกเราจะต้องดาวน์โหลด Mobile Services SDK เพื่อนำไป Import ใน Project ของเรา และก็ทำตามคำแนะนำต่าง ๆ เช่นการกำหนด Permission ในไฟล์ AndroidManifest.xml

Windows Azure Mobile Services Start Up

กรณีต้องการสร้าง Table ใหม่

หากยังไม่เข้าใจก็สามารถข้ามหัวข้อนี้ไปได้เลยครับ เพราะเป็นเพียงการอธิบายให้เข้าใจคร่าว ๆ เท่านั้น ส่วนบทความการใช้งาน Mobile Services กับ Android , Windows Phone และ iOS สามารถอ่านได้จากบทความในหัวข้อนั้น ๆ ในบทความถัด ๆ ไป


.

   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2013-05-07 11:54:35 / 2017-03-24 11:01:48
  Download : No files
 Sponsored Links / Related

 
ตอนที่ 1 : รู้จักกับ Azure Mobile Services คืออะไร ทำไมจะต้องใช้ Mobile Services
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่