Popular blog tags

Android|Android Studio|Visual Studio编程入门教程之目录和总结

Published

In this article, he shares this latest development milestone – The android app development roadmap. If you are keen to get started building your first Android apps, then read on. 

Table of Content

Web App vs Hybrid App vs Native App

Part 1:Native  App Development

part 2:Web App Development

 

Android Application Fundamentals

You will find three different ways to learn its mobile development platform.

You will find many different tools that can be used for android app development.

The android tools include the Android support libraries and framework, the android interface, and a variety of other APIs.

Android development tools

In Android with Android Studio development tool , programming is done in two languages JAVA or Kotlin

Android Studio 

Android Studio 
    SDK samples (Java)
    SDK samples (Kotlin)

Visual Studio  

Visual Studio    
    Xamarin.Android - Xamarin for Java developers   
                                -Xamarin for .Net developers  
                                    Xamarin.Android exposes the complete Android SDK for .NET developers. 
                                    Build fully native Android apps using C# or F# in Visual Studio    
   .NET MAUI   Framework-Create a new MAUI Mobile application(c#)-.NET MAUI   Framework(a cross-platform framework)

Android SDK API Levels

Android 11.0 - API 30
Xcode development environment

 

 

 

Web App vs Hybrid App vs Native App

目前主流应用程序大体分为三类:Web App、Hybrid App、 Native App

Native APP

指的是原生程序,一般依托于操作系统,有很强的交互,是一个完整的App,可拓展性强。需要用户下载安装使用。

Web App

指采用Html5语言写出的App,不需要下载安装。类似于现在所说的轻应用。生存在浏览器中的应用,基本上可以说是触屏版的网页应用。

Hybrid APP

指的是半原生半Web的混合类App。需要下载安装,看上去类似Native App,但只有很少的UI Web View,访问的内容是 Web 。

Also, because Blazor isn't sandboxed like JavaScript web apps, Blazor Hybrid apps allow access to native device capabilities, opening up all kinds of scenarios to work with a machine's file system and other resources, even editing local images and text. Blazor functionality is served up in an embedded Web View, so WebAssembly, the backing technology for client-side Blazor, isn't needed.

Mixing and Matching Native and Web UI

案例:

 

Web App:百度地图

Hybrid APP:新闻类APP,视频类APP普遍采取的是Native的框架,Web的内容

 

Android app development which will provide you with guidance regarding the various tools and language packs available to develop Android apps.

 

Part 1:Native App Development

Android Studio VS Eclipse

Android Stuido是Google推出,专门为Android“量身订做”的,是Google大力支持的一款基于IntelliJ IDEA改造的IDE.

国内用Eclipse的还是大多数。

 

一、Android Studio编程入门教程之目录

第一部分:Android开发环境

Android编程入门之一(Android Studio安装过程图解)

第二部分:Android应用程序框架

Android编程入门之二(Android 8.0:短信转发权限适配)

How To Change Minimum Sdk Version In Android Studio

 

 

 

开发标准(原生) Android  app

1.开发原生Android app

1.可以使用Android Studio (Java 或 Kotlin)

2.可以使用Visual Studio 2022     (c#,c++,java)-cross-platform solution

    Android and iOS development with C++ in Visual Studio

Part 2:用c#跨平台框架开发Android app

Compare Xamarin.Native vs Xamarin.Forms  vs Xamarin .NET MAUI

1.app基本代码通常由 UI 代码组成,用于创建用户界面(如页面、按钮控件、标签、列表等)和逻辑代码,用于调用 Web服务、访问数据库、调用硬件功能和管理状态。 平均而言,90% 可以重复使用,但通常需要自定义每个设备平台的代码。

2. 跨平台框架提供单一代码库, (主要) Android、iOS 和 Windows设备之间共享。

第1阶段:Xamarin Native (Xamarin.Android)

Note: developers often refer to Xamarin.Android and Xamarin.iOS as “Xamarin Native” or “Xamarin Traditional;” 

Xamarin.Android only allows you to target android.

UI :xamarin.adroid uses the Android designer.

只有逻辑代码跨平台共享,而不是 UI 代码共享。

第2阶段:Xamarin Forms (Xamarin.Forms)

Xamarin forms allows you to create cross platform apps for example a Xamarin forms app could work on an IPhone, Android, Windows UWP, MacOs, Tizen, GTK#(Linux), and WPF.

UI:Xamarin forms uses Xaml to define the UI 

在 Android、iOS 和 Windows应用之间共享大约 60-90% 的逻辑和 UI 代码

The first release of Xamarin Forms was in 2014 when Xamarin was still an independent company.

Xamarin Forms 5.0 will have a short life. "Xamarin.Forms will ship a new major version later this year, and continue to ship minor and service releases every 6 weeks through .NET 6 GA in November 2021. The final release of Xamarin.Forms will be serviced for a year after shipping.

Xamarin Forms Version 5.0 is the "new major version" he was referring to, and active support for Xamarin Forms (any version) is scheduled to end November 2022.

see:Last stop before MAUI: Xamarin Forms 5.0 released for cross-platform mobile, new features, new bugs

 

第3阶段:.NET MAUI App Development

 

Multi-platform App UI (MAUI) will replace Xamarin Forms.

.NET MAUI is a cross-platform framework that is used to create native desktop and mobile applications. It is the most productive way to create, performant Android, iOS, macOS, and Windows Apps, all from a single code base.

.NET MAUI利用了Android、iOS、macOS和Windows的平台sdk.

从头学Java,需要花的时间成本太大。

用c#在VS2019下编写APP程序。

优点:VS2019的移动跨平台采用Xamarin架构,熟悉Visual Studio的开发者不用再熟悉其他的开发工具就能直接开发移动应用程序。

经过几年的发展,VS集成Xamarin方面做得越来越方便。

 

 

 

c#  Android

20211108

Xamarin.iOS and Xamarin.Android  become part of .NET 6 as .NET for iOS and .NET for Android.

 

.NET MAUI, being an evolution of Xamarin.Forms

用c#跨平台框架开发Android app的三种途径

create android app project with c# Xamarin.Android

create android app project with c# Xamarin.Forms

create android app project with c# .NET MAUI

用c# xamarin原生

用c# xamarin.forms写

用c# .NET MAUI写

 

结论

 

 

 

vs

用xamarin.forms写了三个项目


优点:

1.同一套代码做两个平台起码70%以上的工作量,省力。尤其是有改动的时候,轻松保持两平台的一致性。
2.可以用c#,使用这门语言,各种特性对我来说非常方便,尤其是带lambda的流式编程和轻松异步,代码不会乱成一锅浆糊。

缺点:

1.仍有百分之二三十的功能要两平台分别开发,而且要分别学习两个平台,目前虽然在.Forms里做这些功能的大神越来越多,但实际项目里还是避不开要使用xamarin原生。
2.社区规模跟两个原生环境没法比。

create android app project with c#  publish step by step

https://blog.csdn.net/l550802356/article/details/112623546

https://www.codeproject.com/articles/663461/developing-android-apps-using-csharp

 

第三部分 分发

Google Play 上架 Step by Step

https://blog.csdn.net/Mr_Sk/article/details/114697793

 

 

有哪些用c#开发的安卓APP?

https://dotnet.microsoft.com/platform/customers/xamarin

Making phone calls and Sending SMS with Xamarin.Essentials-https://blog.logrocket.com/using-xamarin-essentials-to-manage-phone-calls-and-sms/

 

Part 3:Web App Development

PWA可以让你的web程序跟一般应用一样运行

https://www.iaspnetcore.com/Blog/BlogPost/5e9bcd071752ad5fd617de0d/aspnet-core-pwa-series-what-are-progressive-web-apps