platform_get_resource

platform_get_resource函数

在后续Linux设备驱动开发中会用到此函数,且在后续文章中会跳转过来,提前埋下种子。
文中提到的《设备树如何转换成platform_device》和《Linux设备树解析》,后续会更新。

platform_get_resource函数原型

功能:从设备中获取相关资源。
参数@dev:平台设备。描述设备信息的,有设备树描述。
参数@type: 资源类型。下文详细讲解。
参数@num: 资源索引。同类型资源进行重新编号后的下标编号,注意和资源数组中的元素数量即num_resources区别。(要注意这一点),最后总结时会讲到。

/**
 * platform_get_resource - get a resource for a device
 * @dev: platform device
 * @type: resource type
 * @num: resource index
 */
struct resource *platform_get_resource(struct platform_device *dev,
				       unsigned int type, unsigned int num)
{
	u32 i;

	for (i = 0; i < dev->num_resources; i++) {
		struct resource *r = &dev->resource[i];

		if (type == resource_type(r) && num-- == 0)
			return r;
	}
	return NULL;
}

补充Linux下设备资源相关知识

IIC、SPI、GPIO 等这些外设都有对应的寄存器,这些寄存器其实就是一组内存空间,Linux内核使用resource结构体来描述一段内存空间,“resource”翻译出来就是“资源”,因此用resource结构体描述的都是设备资源信息,resource 结构体定义在include/linux/ioport.h 中,定义如下:

/*
 * Resources are tree-like, allowing
 * nesting etc..
 */
 struct resource {
 resource_size_t start;
 resource_size_t end;
 const char *name;
 unsigned long flags;
 unsigned long desc;
 struct resource *parent, *sibling, *child;
 };


对于 32 位的 SOC 来说,resource_size_t 是 u32 类型的。
其中 start 表示开始地址,end 表示结束地址,
name 是这个资源的名字,flags 是资源标志位,一般表示资源类型,
可选的资源标志定义在文件 include/linux/ioport.h 中,如下所示:

/*
 * IO resources have these defined flags.
 *
 * PCI devices expose these flags to userspace in the "resource" sysfs file,
 * so don't move them.
 */
#define IORESOURCE_BITS		    0x000000ff	/* Bus-specific bits */

#define IORESOURCE_TYPE_BITS	0x00001f00	/* Resource type */
#define IORESOURCE_IO		    0x00000100	/* PCI/ISA I/O ports */
#define IORESOURCE_MEM		    0x00000200
#define IORESOURCE_REG		    0x00000300	/* Register offsets */
#define IORESOURCE_IRQ		    0x00000400
#define IORESOURCE_DMA	    	0x00000800
#define IORESOURCE_BUS		    0x00001000

#define IORESOURCE_PREFETCH	    0x00002000	/* No side effects */
#define IORESOURCE_READONLY		0x00004000
#define IORESOURCE_CACHEABLE	0x00008000
#define IORESOURCE_RANGELENGTH	0x00010000
#define IORESOURCE_SHADOWABLE	0x00020000

#define IORESOURCE_SIZEALIGN	0x00040000	/* size indicates alignment */
#define IORESOURCE_STARTALIGN	0x00080000	/* start field is alignment */

#define IORESOURCE_MEM_64		0x00100000
#define IORESOURCE_WINDOW		0x00200000	/* forwarded by bridge */
#define IORESOURCE_MUXED		0x00400000	/* Resource is software muxed */

#define IORESOURCE_EXT_TYPE_BITS 0x01000000	/* Resource extended types */
#define IORESOURCE_SYSRAM		0x01000000	/* System RAM (modifier) */

#define IORESOURCE_EXCLUSIVE	0x08000000	/* Userland may not map this resource */

#define IORESOURCE_DISABLED		0x10000000
#define IORESOURCE_UNSET		0x20000000	/* No address assigned yet */
#define IORESOURCE_AUTO			0x40000000
#define IORESOURCE_BUSY			0x80000000	/* Driver has marked this resource busy */

大家一般最常见的资源标志就是IORESOURCE_MEM ,IORESOURCE_REG 和 IORESOURCE_IRQ 等。比如后续更新的Linux下CAN驱动开发中也使用了platform_get_resource(pdev,IORESOURCE_MEM, 0),IORESOURCE_MEM代表内存地址。

回到正题,继续分析上面函数

描述设备信息,传统的用 platform_device 来描述设备信息。当 Linux 内核支持了设备树以后就不需要用户手动去注册platform 设备了。因为设备信息都放到了设备树中去描述,Linux 内核启动的时候会从设备树中读取设备信息,然后将其组织成 platform_device 形式,至于设备树到 platform_device 的具体过程参考《设备树如何转换成platform_device》

下面列举platform_device这种“古老”方式来编写设备信息,用来分析platform_get_resource如何拿到设备信息的。设备树方式来编写设备信息的框架就不写了,现在很常用,后续更新设备树的详细介绍,包括语法等,参考《Linux设备树解析》。

/******************** 采用自定义platform_device这种“古老”方式来编写设备信息 **********************/
// 简要描述xxxdevice.c 即platform_device框架如下所示
    
#include <linux/xxx.h>
......
  
/* 寄存器地址定义*/
#define PERIPH1_REGISTER_BASE (0X20000000) /* 外设 1 寄存器首地址 */
#define PERIPH2_REGISTER_BASE (0X020E0068) /* 外设 2 寄存器首地址 */
#define REGISTER_LENGTH 4

/* 设备资源信息 */
static struct resource xxx_resources[] = {
	[0] = {
	.start = PERIPH1_REGISTER_BASE,
	.end = (PERIPH1_REGISTER_BASE + REGISTER_LENGTH - 1),
	.flags = IORESOURCE_MEM,
	},
	[1] = {
	.start = PERIPH2_REGISTER_BASE,
	.end = (PERIPH2_REGISTER_BASE + REGISTER_LENGTH - 1),
	.flags = IORESOURCE_MEM,
	},
};

/* platform 设备结构体 */
static struct platform_device xxxdevice = {
	.name = "xxx-peripheral",
	.id = -1,
	.num_resources = ARRAY_SIZE(xxx_resources),
	.resource = xxx_resources,
};

/* 设备模块加载 */
static int __init xxxdevice_init(void)
{
	return platform_device_register(&xxxdevice);
}

/* 设备模块注销 */
static void __exit xxx_resourcesdevice_exit(void)
{
	platform_device_unregister(&xxxdevice);
}

module_init(xxxdevice_init);
module_exit(xxxdevice_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("TieTouXiaoGe");

/*********************************************** 结束 *********************************************/

所以上述for循环的次数即资源数组xxx_resources[]的元素数量。
struct resource *r = &dev->resource[i]; 表示从第一份资源开始逐个搜索,
然后if (type == resource_type( r ) && num-- == 0),这行代码首先通过
type == resource_type( r )判断当前这份资源的类型是否匹配,如果匹配则再通过num-- == 0判断是否是你要的(这里先判断是否等于0再自减1),如果不匹配重新提取下一份资源而不会执行num-- == 0这一句代码。通过以上两步就能定位到你要找的资源了,接着把资源返回即可。如果都不匹配则return NULL。

总结

// 设备驱动开发中常用 
struct resource *res
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
// 获取设备内存地址资源。
    
struct resource *platform_get_resource(struct platform_device *dev,
			                                    unsigned int type, unsigned int num)

unsigned int type决定资源的类型,unsigned int num决定type类型的第几份资源(从0开始)。即使同类型资源在资源数组中不是连续排放也可以定位得到该资源。比如第一份IORESOURCE_IRQ类型资源在resource[2],而第二份在resource[5],那platform_get_resource(pdev,IORESOURCE_IRQ,0);可以定位第一份IORESOURCE_IRQ资源;
platform_get_resource(pdev,IORESOURCE_IRQ,1);可以定位第二份IORESOURCE_IRQ资源。
之所以能定位到资源,在于函数实现中的这一行代码:
if (type == resource_type( r ) && num-- == 0)该行代码,如果没有匹配资源类型,
num-- == 0不会执行而重新提取下一份资源,只有资源匹配了才会寻找该类型的第几份资源,即使这些资源排放不连续。(解释了上面的参数@num)

  • 6
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
EhLib 9.3 Build 9.3.026 source included version. ------------------------------------------------- The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE10.3, Lazarus. TABLE OF CONTENTS ----------------- Overview Installation Library Installation Help Demonstration Programs Registering and Prices Other information About author Where to start. ------------------- Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) If you've used previous versions of the library, then you can read a summary of the new features and changes in the file history-eng.html. More detail about new features in this version of the library can be found in the file - About EhLib 9.2 Eng.doc To install a new version of the library in the IDE, use the installation program .\Installer\EhLibInstaller.exe If, at the installation have any problems, write a letter to ehlib support address [email protected] You can also install the files in the library IDE manually, as described in Section 2. Installation Library After installation, make sure the operability of all installed components. To do this, open the IDE, compile and launch a major demonstration project .\Demos\MainDemo\Project1_XE2.dpr Read next file for full instructions of working with the library components: .\Hlp\ENG\"EhLib - Users guide.doc" Read about EhLib for Lazarus in the file - Lazarus<*>\readme.txt Overview -------- The Library contains several components and objects. TDBGridEh component TDBGridEh provides all functionality of TDBGrid and adds several new features as follows: Allows to select records, columns and rectangle areas. Special titles that can correspond to several/all columns. Footer that is able to show sum/count/other field values. Automatic column resizing to set grid width equal client width. Ability to change row and title height. Allows automatic broken of a single line long title and data row to a multiline. Title can act as button and, optionally show a sort marker. Automatically sortmarking. Ability to truncate long text with ellipsis. Lookup list can show several fields. Incremental search in lookup fields. Frozen columns. DateTime picker support for TDateField and TDateTimeField. Allows to show bitmaps from TImageList depending on field value. Allows to hide and track horizontal or vertical scrollbars. Allows to hide columns. Allows to show 3D frame for frozen, footer and data rows. Allows to draw memo fields. Multiline inplace editor. Proportional scrolling independently of sequenced of dataset. Automatically show checkboxes for Boolean fields. Allows to show checkboxes for other type of fields. Has a procedures to save and restore layout (visible columns, columns order, columns width, sortmarkers, row height) in/from registry or ini file. Allows to show hint (ToolTips) for text that don't fit in the cell. Allows to export data to Text, Csv, HTML, RTF, XLS and internal formats. Allows to import data from Text and internal formats. Can sort data in various dataset's. Can filter data in various dataset's. When DBGridEh is connected to DataSet of TMemTable type it allows: To view all data without moving active record. To display a tree-type structure of TMemTable records. To form list of values in dropdown list of SubTitle filter automatically. To create grouping records basing on the selected coulmns. TDBVertGridEh component Component to show one record from dataset in Vertical Orientation. Have a special column to show Field Captions Can customize inplace editor and data of the cell like in DBGridEh. TDBLookupComboboxEh component Provides all functionality of TDBLookupCombobox and adds several new features as follows: Can have flat style. Allows assign values as to KeyValue property just and to display Text property. Allows to type (assign) values to Text property not contained in data list (Style = csDropDownEh). Allows to hold KeyValue and Text as not affecting to each other values. Take effect when KeyField, ListField, ListSource, DataField and DataSource properties is empty. Drop down list can: Show titles, Have sizing grip, Automaticaly set width as sum of DisplayWidth of the list fields (Width = -1), Automaticaly drops on user pressed the key. Edit button can: Show DropDown, Ellipsis or Bitmap image. Have specified width. Have additional events: OnKeyValueChanged, OnButtonClick. TDBSumList component This component is intended for totaling sums and amounts of records in a TDataSet with dynamic changes. Component keeps a list of TDBSum objects, which contains types of group operations (goSum or goCount) and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and routines for preview and print of TDBGridEh component with several features: Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page footer where you can specify macros for current page, current date, current time and/or static text. Automatically print/preview multiselected area of TDBGridEh if it area is not empty. Ability to print/preview rich text before and after grid. TPreviewBox component TPreviewBox lets you create a customizable runtime preview. TPrinterPreview object TPrinterPreview lets you to record printable data in buffer for following output them on screen and to printer. TPrinterPreview have all functions and properties as in TPrinter object. You can use TPrinterPreview object similarly of TPrinter except some details. In TPrinter Printer.Canvas.Handle and Printer.Handle is the same but in TPrinterPreview PrinterPreview.Canvas.Handle represent the metafile in that is recored the data and PrinterPreview.Handle represent Printer.Handle. That is mean that you have to use PrinterPreview.Canvas.Handle for draw operation (DrawText, DrawTexteEx, e.t.c.) and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows data in default preview form. TDBEditEh component represents a single or multi-line edit control that can display and edit a field in a dataset or can works as non data-aware edit control. TDBDateTimeEditEh component represents a single-line date or time edit control that can display and edit a datetime field in a dataset or can works as non data-aware edit control. TDBComboBoxEh component represents a single or multi-line edit control that combines an edit box with a scrollable list and can display and edit a field in a dataset or can works as non data-aware combo edit control. TDBNumberEditEh component represents a single-line number edit control that can display and edit a numeric field in a dataset or can works as non data-aware edit control. TPropStorageEh, TIniPropStorageManEh, TRegPropStorageManEh components Components realize technology to store component properties to/from settings storage such as ini files, registry etc. TMemTableEh component dataset, which hold data in memory. Its possible consider as an array of records. Besides, it: Supports a special interface, which allows DBGridEh component to view all data without moving active record. Allows fetch data from TDataDriverEh object (DataDriver property). Allows unload change back in DataDriver, operative or postponed (in dependencies of the CachedUpdates property). Allows to create a master/detail relations on the client (filtering record) or on the external source (updating parameters [Params] and requiring data from DataDriver). Allows once-only (without the dynamic support) sort data, including Calculated and Lookup field. Allows create and fill data in design-time and save data in dfm file of the Form. Allows keep record in the manner of trees. Each record can have record elements-branches and itself be an element to other parental record. Component TDBGridEh supports to show the tree-type structure of these records. Allows to connect to the internal array of other TMemTableEh (via ExternalMemData property) and work with its data: sort, filter, edit. Has interface for requesting list of all unique values in one column of records array, ignoring local filter of the DataSet. TDBGridEh uses this property for automatic filling a list in DropDownBox of the subtitle filter cell. TDataDriverEh component carry out two tasks: Delivers data to TMemTableEh. Processes changed records of TMemTableEh (writes them in other dataset, or call events for processing the changes in program). TSQLDataDriverEh DataDriver that have four objects of the TSQLCommandEh type: SelectCommand, DeleteCommand, InsertCommand, UpdateCommand, GetrecCommand. TSQLDataDriverEh can not transfer queries to the server but it call global (for application) event which it is necessary to write to execute SQL expressions on the server. TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh Components. These are SQLDataDrivers that can deliver queries to the server using corresponding drivers of the access to datas. -------------------- 2. Installation Library -------------------- -------------------- 2.1 Installing library automatically -------------------- Run EhLibInstaller.exe program from "Installer" folder to install EhLib in Delphi/C++ Builder IDE. The program creates folders to keep EhLib binary and other requared files, copies requared files to created folders, compiles packages, register packages in IDE and write requared paths in registry. If you have executable installation program (for example, EhLibSetupD7Eval.exe) then you only need to run program and follow installation process. Setup automatically writes all units in necessary directory, installs packages and help files in IDE. -------------------- 2.2 Installing library manually ------------------- Follow next instructions to install files from EhLib archive: -- 2.2.1. For RAD Studio XE2 (Delphi) or higher: --------------------------------------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, DclEhLibDataDriversXX files). These files can be located in the following folders on your computer C:\Users\All Users\Documents\RAD Studio\1X.0 C:\Users\All Users\Documents\Embarcadero\Studio\XX.0\Bpl C:\Users\All Users\Documents\Embarcadero\Studio\XX.0\Dcp Create new folder where source code and binary files will be kept (For example, C:\RAD_Studio_XE2\Components\EhLib). Hereinafter this folder will be call as "EhLib folder". Create new subfolder "Lib" in the "EhLib folder". Copy files from folders "Common", "RADStudioXE2" and "LangResources\Res" of EhLib archive into the folder "[EhLib folder]\Lib" as that all files were in one folder - "Lib". Default language resource of the library is English. If you want to change it to the other language do the next steps: - Select one of language file EhLibLangConsts.XXX.dfm - Copy this file to EhLibLangConsts.dfm file (with replacment of existing file) - In the first line of a new EhLibLangConsts.dfm file delete _XXX suffix in the name of object like this: object TEhLibLanguageConsts_ENU -> object TEhLibLanguageConsts Run RAD Studio IDE and Open EhLibProjGroup160.groupproj file from [EhLib folder]\Lib. Compile all packages of Prject Group. Install DclEhLibXX.Dpk and DclEhLibDataDriversXX.Dpk packages in IDE (Use Project/Install menu). Consistently compile packages EhLibXX.Dpk and EhLibDataDriversXX.Dpk in next modes: Win32\Debug Win64\Release Win64\Debug After compilation there should be created subfolders a Win32\Release, Win32\Debug, Win64\Release, Win64\Debug in the "[EhLib folder]\Lib" folder. Copy the *. dfm and *. res files from the "[Folder EhLib]\Lib" folder into the each of the next folders: Win32\Release, Win32\Debug, Win64\Release, Win64\Debug In the RAD Studio IDE add next paths: "[EhLib folder]\Lib\Win32\Release" path in the "Library path" for the Win32 platform. "[EhLib folder]\Lib\Win32\Debug" path in the "Debug dcu" for the Win32 platform. "[EhLib folder]\Lib\" path in the "Browsing path" for the Win32 platform. "[EhLib folder]\Lib\Win64\Release" path in the "Library path" for the Win64 platform. "[EhLib folder]\Lib\Win64\Debug" path in the "Debug dcu" for the Win64 platform. "[EhLib folder]\Lib\" path in the "Browsing path" for the Win64 platform. -- Copy DEMOS folder from the Archive EhLib to the "[EhLib Folder]". Open and compile any demo project for test. 2.2.2. Delphi 5.x - 7.x, Delphi 9.X Win32, BDS2006 Win32, Delphi2007, CodeGear RAD Studio 2009: ------------------------------------------------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, DclEhLibDataDriversXX files). Create directory from which you will install EhLib library ('EhLib directory') (for example, C:\Delphi[X]\EhLib). Copy files from "Common", "Delphi[X]" | "BDS2006" and "LangResources\Res.Ansi" folders of the EhLib archive to 'EhLib directory'. Default language resource of the library is English. If you want to change it to the other language do the next steps: - Select one of language file EhLibLangConsts.XXX.dfm - Copy this file to EhLibLangConsts.dfm file (with replacment of existing file) - In the first line of a new EhLibLangConsts.dfm file delete _XXX suffix in the name of object like this: object TEhLibLanguageConsts_ENU -> object TEhLibLanguageConsts By default Delphi (5, 6 and 7) places compiled files to the <Delphi path>\Projects\Bpl directory and this directory already present in the search PATH. But if you overwrite default BPL directory then you need put compiled EhLibXX.BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory). Add, (if needed) 'EhLib directory' in Tools->Environment Options->Library-> Library Path (For Delphi 9 in Tools->Options->Environment Options-> Delphi Options->Library - Win32->Library Path). Use "File\Open..." menu item of Delphi IDE to open the runtime package - EhLibXX.Dpk. In "Package..." window click "Compile" button to compile the package. After that open and compile EhLibDataDriversXX.Dpk. After compiling run-time packages install design-time packages DclEhLibXX.BPL and DclEhLibDataDriversXX.BPL into the IDE. For that use "File\Open..." menu item to open design-time package DclEhLibXX.Dpk. In "Package..." window click "Compile" button to compile the package and then click "Install" button to register EhLib components on the component palette. Open and install DclEhLibDataDriversXX.Dpk package. EhLib components have to appear on 'EhLib' page of components palette. 2.2.4. Delphi 9.X Vcl.Net, , BDS2006 Vcl.Net: ---------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including Vcl.EhLib90.dll, Vcl.DclEhLib90.dll, Vcl.EhLibDataDrivers90.dll, Vcl.DclEhLibDataDrivers90.dll files). Create directory from which you will install EhLib library ('EhLib directory') (for example, C:\BDS\3.0\EhLibVclNet). Copy files from Common and Delphi9 directories of the EhLib archive to 'EhLib directory'. In Delphi IDE: Add, (if needed) 'EhLib directory' in Component->Installed .NET Components ...-> Assembly Search Paths. Add, (if needed) 'EhLib directory' in Tools->Options->Environment Options-> Delphi Options->Library - NET->Library Path. Use "File\Open..." menu item of Delphi IDE to open the runtime package - Vcl.EhLibXX.Dpk. In "Project Manager..." window, click right button above 'Vcl.EhLibXX.Dll' and select "Build" menu to compile package. After that, open and compile Vcl.EhLibDataDriversXX.Dpk, Vcl.DclEhLibXX.Dpk and Vcl.DclEhLibDataDriversXX.Dpk. Open menu "Component->Installed .NET Components ..."->.NET VCL Components. Press 'Add...' button. Locate 'Vcl.DclEhLibXX.dll' and press 'Open'. (By default, this file have to be located in 'EhLib directory' directory) Press 'Ok' in 'Installed .NET Components' Dialog. 4. Documentation and Help ------------------------- 4.1. This version of library doesn't have embedded help files for Delphi8 or Higher. But the online help is available on the ehlib home page - http://www.ehlib.com/online-help 4.2. Delphi 7.x: Copy the EhLib.hlp and EhLib.cnt files to the Delphi HELP subdirectory. Select Help|Customize to start the OpenHelp application. Add the EhLib.cnt file to the Contents page, add the EhLib.hlp file to the Index and Link pages. 5. Demonstration Programs and Projects -------------------------------------- Demonstration programs use tables from the DEMOS directory and ADO Data Access. Read description of Demo projects in the file Demos\Info Eng.doc 6. Registering and Prices ------------------------- The EhLib is a Commercial product. If you find it useful and want to receive the latest versions please register your evaluation copy. You can read detailed information about prices on ehlib home prices page http://www.ehlib.com/buy You can read detailed information about registration at https://secure.shareit.com/shareit/product.html?productid=102489 After registration you will receive (e-mail only) address of registered version for downloading and password for unpacking. By registering the components you get the following advantages: 1. You will get new versions of the library free within a year from the date of registration. 2. You will get technical support for the library all the time. 3. You encourage EhLib Team to make the library even better. 7. Other information ----------------- The ability to compile applications for OS X and Linux in combination with the CrossVCL library is only available in the EhLib version with source codes. The ability to compile applications under Linux is available only in the EhLib version with source codes. 8. About Company ---------------- Contact as if you have any questions, comments or suggestions: EhLib Team www: http://www.ehlib.com E-mail: [email protected] Skype support: ehlib.support
This book walks the developer through the process of tailoring their apps in order to appeal to a global market. Microsoft MVP Chris Miller steps you through the process of enabling multiple language support, while using a single shared set of language resources using the .NET Framework. .NET makes it easy to support multiple languages and cultures. Starting with a simple mobile application, the author demonstrates how to adapt it for the Android, iOS, and Windows platforms, showing how to handle the localization with resource files and how to handle internationalization on each platform. Readers will learn how to test the application for the localization support and how to avoid common pitfalls. Using Xamarin.Forms and Visual Studio, the app will be implemented for Android, iOS, and Windows 10 UWP and 99% of the code will be shared across the platforms. What You Will Learn Localization and Internationalization and why they matter How multiple languages are supported on each platform How cultural differences like dates and currencies are handled How to use tools like Microsoft’s Multilingual App Toolkit to manage language resources How to create an localized, cross-platform app with Android Studio, Xcode, Xamarin and Visual Studio tools How to get help translating the text from the application Who This Book Is For Mobile app developers currently writing native apps for Windows Phone, Android, and iOS. The Android and iOS native apps will be written using Xamarin and also with the native tool kits, the Windows apps with the stock Visual Studio tools. Table of Contents Chapter 1: What Is Localization? Chapter 2: Working with Resource Files Chapter 3: Working with Multilingual App Toolkit Chapter 4: Island Menu Application Chapter 5: Additional Resources Book Details

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

铁头小哥

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值