Android Application With SQL Server using Web Service Part 1

by

Hi,

In this Article will talk about SQL Server, how to connect to SQL Server Live Database.

but this time will not .NET or Microsoft Tools to read or write andy data from our database.

Today will be Android Application.

will use Android Studio 2.3.3 or Higher for this Application.

So, how to connect to SQL database, its very simple not simple same as, .NET

maybe SOAP package will make it easy. 

Our Project will be Login  Application.

will content 2 parts :

1- ASP.NET Web Service.

  Youtube Link  GitHub Project . 

In this article, I'm not going to talk about Web Service.

2- Android Application, How to Login with Email and Password with Live SQL Database. 

 Youtube Link    GitHub Project 1 .  GitHub 2

Will have  2 Activities and Layouts. 

1- Main Activity or Home Activity this will be opened if the result of login True.

2* Login Activity, this one will have 2 EditText for Email and Password,

and sure one Button For Sign In. 

Let's Start our Android Application with creating a new project.

New Project

- Choose a name for your project.

-  Will Generate New Empty Activity and Layout.

So, this one will Be Home Activity as I mention it will open if the Email and Password True.

You can create any Text View and write in it Welcome or Hello World :).

-Let's create one more Activity and call it Login Activity, this will be for the main job.

 

 

part 2

 

What is MVC?

by

The Model-View-Controller is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.

MVC Components

 

Model

The Model component corresponds to all the data-related logic that the user works with. This can represent either the data that is being transferred between the View and Controller components or any other business logic-related data. For example, a Customer object will retrieve the customer information from the database, manipulate it and update it data back to the database or use it to render data.

View

The View component is used for all the UI logic of the application. For example, the Customer view will include all the UI components such as text boxes, dropdowns, etc. that the final user interacts with.

Controller

Controllers act as an interface between Model and View components to process all the business logic and incoming requests, manipulate data using the Model component and interact with the Views to render the final output. For example, the Customer controller will handle all the interactions and inputs from the Customer View and update the database using the Customer Model. The same controller will be used to view the Customer data.

ASP.NET Web Service

by

ASP.NET Web Service 

?????? ????? ????? ???? ??????? .

?? ????? ?????? ??  ?? ??????? ?? ????? ????? Web Service   .

??????? , ?????? ????????? ?? ??? ??????? ?? ????? ??? , ????? ??????? ????? ?? ??????? ????? ???? ?? ?????? ??? ???? ?????? ?? ASP.NET Web Service  .

?? ??? ????? ??? Java  ?? PHP  .

??? ?? ???? ????? ????? , ??????? ???? ????? ??? ???? ??????? , ?????????? ?? ?? ???????? ?? ??? ??????? .

- ?? ?????? ?? ??? ??? ???? ???  , ??? ???? ?????? Yahoo  , ?? ?? ???? ??? .

??? ?? ?????? ???? ????? , ?? ???? ?????? ??????? ......

??? ?? ????? ????? , ??? ???? ?????? ??????? ???? ????? ????? , ????? ???????? ,

???? ????? ????? ,?????? ?????? ........

????? ????? ??? ???? ?? ASP.NET Web Service  .

- ??? ????? , ?? ?? Hello World  .

--???? ????? ?????? , ????? ????? ???? .

 

?? ???? ????? ???? .....

 

???? ??? ??????? ?????? ?????? ....

??? ????? ??????? ?????? , ???? ??????  ??? ?????? ??? ?? ?????? ??????? :

 

???? ??? ????? ?????? , ????? ???????? .

 

???? ??? ????? ?????? , ??? ???? ?? ?????? ??????? ???? ???? ???? Helloworld  ??? ?????? ??? ?? ???? ???? Hello World  .

 

??? ????? ??? Helloworld  . ??? ????? ??? XML , ???????? .

 

???? ????? ?? ???? , ?? ??? , ??? ????????  , ???? ??????? ??????? .

- ??? ??? ??? ????? .

??? ???? ?????? ??????? , ?????? ADD  ???? ???? A  ? b  ?????? ?????? .

???? Run  .

???? ????? ???????? Helloworld  ? Add  .

 

?????? ?????? ADD   , ???? ?????? ??????? ,, ????? ????? ?? a and b  ??? ?? Invoke

 

?????? ?? ::

?

 

 

???? ???? ???? , ???? ????????? ??? , ?? ????? Projects  .

 

 

CKEditor ASP.NET MVC 5

by

السلام عليكم , 

اليوم سوف  نقوم بشرح كيفية تركيب CKEditor   على ASP.NET MVC 5

 سوف نستخدم الجدول التالي , على SQL Server  .كما هو مبين في الصوره .

الجدول كما هو مبين , فقط ID  و Titile  و Post_Content وهو المهم في مشروعنا .

- الخطوه التاليه هي في Visual Studio , وهي انشاء مشروع MVC  .

- من Nuget  نقوم باضافة مكتبة CKEDITOR  اي اصدرا منها .

 

- اضافة الكود التالي في Controller  , عباره عن كود اضافة او حذف من الداتا بير SQL Server  .

 

الجزء الاهم في موضوعنا هو كيف نقوم بستبدال  EditorFor  التى يتم توليدها من Razor   ب TextAreaFor  .

حتى يتم التعرف عليها من CKEDITOR TOOL  . مع التغيير التالي للاشاره إليها 

 

  new { @class = "ckeditor" }  

كما هو موضح في الصوره قمنا بالاستبدال واضافة الكود التالي :

 

عند تشغيل المشروع يتم استبدال النص باداة CKEDITOR .

كما في الصوره التاليه :

 

 

 ملاحظة : 

طبعا عند كتابة اي سطر في CKEDITOR  , سيتم حفظها في SQL Server Database  , على انها HTML Code  .

لذلك عند عمل جلب للداتا مره اخرى من الداتا بيز لعرضها , يجب ان تكون Raw  كما هو في الصوره التاليه :

بعض عيوب الاداة CKEDITOR  هي عدم دعمها الكامل للASP.NET  من جانب دعم رفع الصور ..

اغلب ال Plugin  تدعم PHP  فقط .

 

تحميل الكود 

Code

 GitHub

 

 

 

 

Image Uploader Using ASP.NET MVC 5

by

Image Uploader Using ASP.NET MVC 5

السلام عليكم , 

المقالة التالية سنشرح كيفية تركيب Image Uploader بستخدام التقنيات التالية 

 ASP.NET MVC and AJAX with SQL Server  .

 

الصوره التالية توضج , اضافة مجلد Upload الذي سيتم حفظ الصور داخله .

 

نقوم ايضا بانشاء SQLServer Database  , بالحقول التالية , التى بدورها ستخفظ مسار الصوره و حجمها على قاعد البيانات . 

 

 

 

 

Code GitHub