In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces you how to develop the MTK Android platform, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Copy the code repository from git@192.168.1.3:a89.git to the work directory:
Cbk@YCS:~/work$ll
Cbk@YCS:~/work$rm-rfa89/
Cbk@YCS:~/work$cd..
Cbk@YCS:~/work$gitclonegit@192.168.1.3:a89.git
two。 Modify xshell user password: passwd
3.Android looks at the version number of the source code
1.) When compiling, it will be printed out at the beginning of the terminal: PLATFORM_VERSION:2.3.1
2.) Go directly to the make file to see: build\ core\ version_defaults.mk// search for the PLATFORM_ version value in the file
4. Compile the specific appsudoku. The source code package is located in..\ package\ app\ sudoku. The command is:
. / mkmmpackage/app/sudoku
5. Set eclipse choose to start different AVD settings:
In eclipse, right-click to specify the app folder, select Runas- > Runconfigrations, select the Target item in the pop-up interface, and select the specified AVD. (similar settings in debug mode)
6.adb command
Adbdevice: view the current linked device status
Adblogcat > my.log: print the current log record to the file my.log
7.adb was unable to start problem analysis:
Adbkill-server, then adb-startserver
8. 9.SDK 's android class library is the SLIM version of the android source project and does not integrate member functions of the "@ hide" type. Therefore, the apk compiled on the SDK is popular everywhere, and the apk compiled on the source project cannot be directly loaded on the platform of other software versions.
10. Print and view the DENSITY_DEVICE of the project to make it easier for the project to confirm the corresponding drawable folder:
Res=getResources (); / / context.getResources ()
Dm=res.getDisplayMetrics ()
Density_device_value=dm.DENSITY_DEVICE
When downloading 11.Flashtool, it is prompted that the preloadusbvcomport driver is not installed. You need to install the specified path:
D:\ Tools\ Mtk_release_Tools_W1316\ Driver (binary)\ SP_Drivers_v1.5\ SP_Drivers_v1.5
In addition, you need to download the mt65xx+preloader+ driver from the Internet, rename the file usb2ser.sys to usbser.sys and copy it to C:\ WINDOWS\ system32\ drivers
Note: if the driver installation is not successful, it may be caused by the lack of usbser.sys and mdmcpq.inf files in the system. You can copy the usbser.sys attached to the path to this document to C:\ WINDOWS\ system32\ drivers, and copy the mdmcpq.inf to C:\ WINDOWS\ inf.
twelve。 Modification of default wallpaper
a. On-screen lock screen interface background picture:
If mtkslidelockscreen, you can replace the following file to modify the background image of the lock interface
\ mediatek\ source\ frameworks\ banyan\ res\ res\ drawable\ lockscreen_default_wallpaper.png
If androiddefaultlockscreen, you can replace the following file to modify the background image of the lock interface
\ frameworks\ base\ core\ res\ res\ drawable\ default_wallpaper.jpg
b. Static wallpaper:
We may add our own wallpaper to the wallpaper selection of the system, which is added in the Launcher module, and we just need to modify:. / packages/apps/Launcher2/res/values-mdpi/wallpapers.xml to add the wallpaperName of our modified wallpaper.
c. Dynamic wallpaper:
Find @ null in the modified frameworks/base/core/res/res/values/config.xml file and modify it to
Com.android.wallpaper/.nexus.NexusWallpaper
Where com.android.wallpaper/.nexus.NexusWallpaper, "/" is preceded by the package name, followed by the class name
Note: if you want to set the third-party dynamic wallpaper program without sourcecode built into the system as the default dynamic wallpaper, you need to know the corresponding class name and package name of the WallpaperService in the apk. You can get the apk resource file through the apk-tool tool provided by Google, then you can look at the AndroidManifest.xml file to find the corresponding WallpaperService class name and package name.
Location of 13.logo files:
Alps\ mediatek\ custom\ common\ uboot\ logo\ logo_folder
Logo_folder: defined in..\ mediatek\ config\ XXXX\ ProjectConfig.mk BOOT_LOGO=wsvganl
Location of 14.Lcd files:
Alps\ mediatek\ custom\ common\ kernel\ lcm\ lcd_folder
Alps\ mediatek\ custom\ common\ uboot\ lcm\ lcd_folder
Lcd_folder: defined in..\ mediatek\ config\ XXXXProjectConfig.mk:
CUSTOM_UBOOT_LCM=zs070#nt35510
CUSTOM_KERNEL_LCM=zs070#nt35510
Location of 15.camera files:
Alps\ mediatek\ custom\ common\ kernel\ imgsensor\ camera_folder
Camera_folder: defined in..\ mediatek\ config\ XXXX\ ProjectConfig.mk:
CUSTOM_HAL_IMGSENSOR=hi253_yuvgc0309_yuv#ov5647_rawhi704_yuv
CUSTOM_HAL_MAIN_IMGSENSOR=hi253_yuv#ov5647_raw
CUSTOM_HAL_SUB_IMGSENSOR=gc0309_yuv#hi704_yuv
CUSTOM_KERNEL_IMGSENSOR=hi253_yuvgc0309_yuv#ov5647_rawhi704_yuv
CUSTOM_KERNEL_MAIN_IMGSENSOR=hi253_yuv#ov5647_raw
CUSTOM_KERNEL_SUB_IMGSENSOR=gc0309_yuv#hi704_yuv
16. Ask, if the resource file in android is modified, such as the contents of the res/values/string.xml file, then how to compile and take effect? I recompiled the module such as mmmpath/module-name, but it didn't seem to work.
Delete the generated jar package and OK it. Specifically under the out/target/common/obj directory
. / mkk6mmpackages/apps/Launcher2
Delete the apk file alps\ out\ target\ product\ K6\ system\ app
. / mksystemimage
17. Basic profile of the project:
Mediatek\ config\ xxx\ ProjectConfig.mk
Build\ target\ product\ common.mk
18. How to add macros in ProjectConfig.mk (note that added macros must be capitalized) to the interface of the Cmax Clipper + source file:
[KEYWORD]
AUTO_ADD_GLOBAL_DEFINE_BY_NAME
AUTO_ADD_GLOBAL_DEFINE_BY_VALUE
AUTO_ADD_GLOBAL_DEFINE_BY_NAME_VALUE
19. How to configure the switches and codes for a baseline project and a specific project respectively:
The code or configuration that needs to be used by all projects is placed in the following directory:
Mediatek/customer/common
Mediatek/config/common
Where should the configuration and code that is used only by a dedicated project be placed?
Mediatek/customer/$project$
Mediatek/config/$project$
20. How to share a code project with many Linux soft links to others:
After unzipping the code package, there are a lot of soft links for linux and many soft links will be generated after compilation. How to copy the code to others and compile normally is very important.
It is forbidden to compress software in the following ways:
1. You can't compress with compression software or copy and paste under windows.
two。 You can no longer compress the code with the right-click compression method under linux; the above methods are to invalidate the link.
The correct way is: tarczfv.tar.gzalps
Which is any name, preferably the project + version of the naming method, alps is the source code directory, has been compressed to the current directory shall prevail.
21. What is the command to compile user version software (UserBuild)
. / makeMtk-opt=TARGET_BUILD_VARIANT=user$ {projectname} new
${projectname} is the project name of the customer
22.GCC tool chain
GCC: (collection of GNUCompilerCollection,GNU compilers) is a set of compilers developed by the GNU Project that support multiple programming languages. GCC is a famous example of the development of free software, released by the Free Software Foundation under the GPL protocol. GCC is the standard compiler for most Unix-like operating systems (such as Linux, BSD, MacOSX, etc.), and GCC is also suitable for Microsoft Windows.
GCC tool chain:
Code meaning of different versions of 23.android (GB,GB2,ICS,ICS2,JB)
AndroidV2.3 (GB,GB2)
AndroidV4.0 (ICS,ICS2): ice cream
AndroidV4.1 (JB): jelly beans
How 24.Android2.3 replaces the MTK sliding lock screen with the google default sliding lock screen:
Please modify the alps/mediatek/config/project_name/ProjectConfig.mk to change the
MTK_LOCKSCREEN_TYPE=2
Modify to
MTK_LOCKSCREEN_TYPE=1
, please re-buildproject after modification
25JBframeowork resource add new rule
The JB version code is a little different from the previous one, that is, to add frameworkresource to JB, you must add it in the
ResourceID is not generated until declared in alps\ frameworks\ base\ core\ res\ res\ values\ Public.xml.
Drawablename
FrameworkinternalbuildAndroidSDK
The method of apk is declared as a frameworkpublic resource. Note that you do not need to write the value of id, and you need to manually updateapi at compile time.
twenty-six。 How to change the default theme to mtkslicer (slim theme)
1frameworks/base/core/java/android/context/res/Configuration.javaSKIN_UNDEFINED
"/ system/framework/theme-res-slicer.apk"
2frameworks/base/libs/utils/AssetManager.cppopenNonAssetString8
ThemeRes ("/ system/framework/framework-res.apk"); String8themeRes ("/ system/framework/theme-res-slicer.apk")
3mediatek/source/frameworks/themes/theme-res-slicer/res/drawable-*dpilockwallpaper.png
Mediatek/source/frameworks/banyan/res/res/drawablelockscreen_default_wallpaper.png
Lockscreen_default_wallpaper.png
4mediatek/source/frameworks/themes/theme-res-slicer/res/drawable-*dpithemewallpaper.png
Frameworks/base/core/res/res/drawabledefault_wallpaper.pngdefault_wallpaper.jpg
twenty-seven。 How to add your own Theme customized in topic management (ThemeManager)
1. Under the alps/mediatek/source/frameworks/themes directory, add your own resource directory theme-res-
Xxx, just take the original 3 sets of theme as an example. You need to prepare the appropriate resources and resources for the newly added theme-res-xxx.
Android.mk/AndroidManifest.xml and other documents
2. In the alps/build/target/product/common.mk file, find the keyword MTK_THEMENANAGER_APP, and in the
In the following judgment, add the name of your own resource bundle
Ifeq ($(strip$ (MTK_THEMEMANAGER_APP)), yes)
PRODUCT_PACKAGES+=theme-res-mint\
Theme-res-mocha\
Theme-res-raspberry\
Theme-res-xxx
Endif
twenty-eight。 How to adapt the self-developed Application to various theme styles in topic management (ThemeManager)?
1. Edit the alps/frameworks/base/data/etc/thememap.xml file to add your own according to the existing app style
For the name of the resource that app wants to replace, refer to Launcher2.
2. For your own app, under the alps/mediatek/source/frameworks/themes/theme-res-xxx (themename) directory
Add the resources corresponding to the specific style, according to the existing app style; also take Launcher2 as an example, pay attention to the information here
The source placement path should be the same as the path of the resource to be replaced in the original app, and the name of the resource should be the same.
twenty-nine。 What is the reason for the blurred and confused display of non-hdpi projects, status bar refresh, or list list interface?
On the 75 platform, AndroidV2.3 and v4.0 versions of MTKrelease to customers, only buildhdpi resources are added to the system by default, that is, only hdpi is added to the MTK_PRODUCT_LOCALESdefault in alps/meidatek/config/xxx/ProjectConfig.mk. If the customer's project is not hdpi, this kind of display error may occur.
Solution: ask customers to manually add the corresponding * dpi to MTK_PRODUCT_LOCALES for other non-hdpi projects: mdpi is required for HVGA resolution, and ldpi is required for QVGA.
thirty。 Background picture of the secondary menu:
Enter the default black background when entering the setting, and put it in the
/ frameworks/base/core/res/res/drawable-nodpi/backgroud_holo_dark.jpg .
The default wallpaper is default_wallpaper.jpg under / frameworks/base/core/res/res/drawable-large-nodpi and drawable-xlarge-nodpi in the system source code.
31.6589 how does the project close NavigationBar:
The default NavigationBar is controlled by alps/frameworks/base/core/res/res/values/config.xml
True
/ / 6589MTKDemoProjectNavigationBarResourceOverlayNavigationBarresourceoverlay:
The 6589navigationBar will overwrite the above settings if it is finally controlled by:
Alps/mediatek/custom/project_name/resource_overlay/generic/frameworks/base/core/res/res/values/config.xml
True
32..9.png picture production
Jdk of java, draw9patch.bat under tools directory in sdk of android
thirty-three。 How to remove the status bar and title bar
Modify the corresponding Activity and add the following code:
FinalWindowwin=getWindow ()
Win.setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN
WindowManager.LayoutParams.FLAG_FULLSCREEN) / / removestatusbar
RequestWindowFeature (Window.FEATURE_NO_TITLE)
RequestWindowFeature (Window.FEATURE_PROGRESS); / / removetitlebar
Note: it must be added before the setContentView () method, or an error will be prompted.
thirty-four。 How to add an icon to the status bar, and how to adjust the display order between the status bar icon:
For more information: MTK_on_line_FAQ_SW_ALPS_20130123.pdf
thirty-five。 In any unlocked screen interface, press a preset button to enter the function of an Activity
PhoneWindowManager.java:interceptKeyBeforeDispatching ()-Unified key response processing Interface
For more information: MTK_on_line_FAQ_SW_ALPS_20130123.pdf
thirty-six。 How to customize the password of the project mode:
* # # 3646633 *
Alps/mediatek/source/packages/EngineerMode/src/com/mediatek/engineermode/EngineerModeReceiver.java
/ / process*#*#3646633#*#*
UriengineerUri=Uri.parse ("android_secret_code://3646633")
Alps/mediatek/source/packages/EngineerMode/AndroidManifest.xml
thirty-seven。 Vibration response interface of touch screen
Call the native method to turn vibrator on and off:
NativestaticvoidvibratorOn (longmilliseconds)
NativestaticvoidvibratorOff ()
The calling method is as follows: VibratorService.vibratorOn ()
38.Database location and reading method:
The following is the path to database (the project of GB2andICS):
-MAUIMETAdatabaseisunderpath:
Alps\ mediatek\ custom\ common\ modem\ ${Project}\ BPLGUInfoCustomApp_MTXXX_S01_MAUI_XXX
-ALPSMETAdatabaseisunderpath:
Alps\ mediatek\ source\ cgen\ APDB_MTXXX_S01_ALPS.XXXX_WXXX
There are two types of Metatool:
One is MAUIMetaTool, which is used to read and modify modem's nvram data.
The other is SP_META, which is used to read and modify nvram data on the Android side.
Nvram data reading method:
First, choose the correct tool
Then connect the computer to the mobile phone through usb, and then click connecttosmartphone in optionmenu
Turn on the phone and the phone will enter the metamode.
Finally, select nvrameditor to select the correct database.
thirty-nine。 How to grab mobilelog
For more information: MTK_on_line_FAQ_SW_ALPS_20130123.pdf
forty。 How to compile a single and double card version
For more information: MTK_on_line_FAQ_SW_ALPS_20130123.pdf
forty-one。 How to debug framework remotely
1. Please create a new java project in eclipse and import the framework code (the imported framework code needs to be the same as the phone's code version)
two。 Please check the TCP port corresponding to system_process in the ddms interface.
3. Please go to run/DebugConfiguration... Add a RemoteJavaApplication to the dialog box that pops up from the menu, select the new project created in step 1, and use the port number obtained in step 2
4. Please set a breakpoint where you need to debug, and then debug
forty-two。 How to confirm the installation location of an application
Android:installLocation= "internalOnly"
Android:installLocation= "auto"
Android:installLocation= "preferExternal" >
For more information: MTK_on_line_FAQ_SW_ALPS_20130123.pdf
forty-three。 How to control the screen to turn on and off in activity
The power supply is controlled by various Lock locks in Android. It should be noted that locking and unlocking must occur in pairs.
/ / enable the screen always on
PowerManagerpm= (PowerManager) getSystemService (POWER_SERVICE)
WakeLock=pm.newWakeLock (PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP,myPowerManager.TAG)
WakeLock.acquire ()
/ / turn off the screen on-screen function
If (wakeLockcargo null) {wakeLock.release ();}
forty-four。 How to install / uninstall APK
Click install in the DDMS tool / ADB command / FileManager folder
On how to develop the MTK Android platform to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.