📄 conaapplicationinstallation.vb
字号:
'Filename : CONAApplicationInstallation.vb
'Part of : Connectivity API VB.NET examples
'Description : Connectivity API data definitions, converted from CONADefinitions.h
'Version : 3.2
'
'This example is only to be used with PC Connectivity API version 3.2.
'Compability ("as is") with future versions is not quaranteed.
'
'Copyright (c) 2007 Nokia Corporation.
'
'This material, including but not limited to documentation and any related
'computer programs, is protected by intellectual property rights of Nokia
'Corporation and/or its licensors.
'All rights are reserved. Reproducing, modifying, translating, or
'distributing any or all of this material requires the prior written consent
'of Nokia Corporation. Nokia Corporation retains the right to make changes
'to this material at any time without notice. A copyright license is hereby
'granted to download and print a copy of this material for personal use only.
'No other license to any other intellectual property rights is granted. The
'material is provided "as is" without warranty of any kind, either express or
'implied, including without limitation, any warranty of non-infringement,
'merchantability and fitness for a particular purpose. In no event shall
'Nokia Corporation be liable for any direct, indirect, special, incidental,
'or consequential loss or damages, including but not limited to, lost profits
'or revenue,loss of use, cost of substitute program, or loss of data or
'equipment arising out of the use or inability to use the material, even if
'Nokia Corporation has been advised of the likelihood of such damages occurring.
Option Strict Off
Option Explicit On
Imports System.Runtime.InteropServices
Module CONAApplicationInstallation
'/////////////////////////////////////////////////////////////////////
'// Connectivity API Application Installation definitions and function
'/////////////////////////////////////////////////////////////////////
' The next define values used to define which type of struct is used:
Public Const CONA_APPLICATION_TYPE_SIS As Integer = &H1 ' Use when struct type is CONAPI_APPLICATION_SIS
Public Const CONA_APPLICATION_TYPE_JAVA As Integer = &H2 ' Use when struct type is CONA_APPLICATION_TYPE_JAVA
Public Const CONA_APPLICATION_TYPE_THEMES As Integer = &H4 ' Use when struct type is CONAPI_APPLICATION_THEMES
Public Const CONA_APPLICATION_TYPE_UNKNOWN As Integer = &H8 ' Use only in CONAPI_APPLICATION_INFO struct, unknown application type.
Public Const CONA_DEFAULT_UNINSTALLATION As Integer = &H100 ' Default uninstallation, used with CONAUninstallApplication function.
Public Const CONA_SILENT_UNINSTALLATION As Integer = &H200 ' Silent uninstallation, used with CONAUninstallApplication function.
Public Const CONA_LIST_ALL_APPICATIONS As Integer = &H1000 '
Public Const CONA_LIST_JAVA_APPICATIONS As Integer = &H2000 ' List all installed java applications, used with CONAListApplications function
Public Const CONA_LIST_THEMES_APPICATIONS As Integer = &H4000 ' List all installed themes, used with CONAListApplications function
' The struct for sis applications
Public Structure CONAPI_APPLICATION_SIS
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrFileNameSis As String ' sis application File name, must be set
' The value can also include the file path in PC.
End Structure
' The struct for java applications
<StructLayout(LayoutKind.Sequential)> Public Structure CONAPI_APPLICATION_JAVA
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrFileNameJad As String ' File name of the jad file. The value can also include the file path in PC.
'If jad file is not available, the value must be NULL.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrFileNameJar As String ' File name of the jar file, must be set.
' The value can also include the file path in PC.
End Structure
' The struct for themes file
<StructLayout(LayoutKind.Sequential)> Public Structure CONAPI_APPLICATION_FILE
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrFileName As String ' File name of the nth file, must be set
' The value can also include the file path in PC.
Dim iOptions As Integer ' Reserved for future use, the value must be 0.
End Structure
'The struct for application info, used with CONAListApplications function
Public Structure CONAPI_APPLICATION_INFO
Dim dwSize As Integer ' Size of struct in bytes.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrName As String ' Application name. Always exist.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrDescription As String ' Application description. If not available, pointer is NULL.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrVendor As String ' Application vendor. If not available, pointer is NULL.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrVersion As String ' Application version. If not available, pointer is NULL.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrParentAppNam As String ' Parent application name. This is available if application is augmentation
' ' for some other application.
Dim dwApplicationSize As Integer ' Application size in bytes. If not available, value is -1 (0xFFFFFFFF).
Dim dwApplicationType As Integer ' Application type possible values:
' ' CONA_APPLICATION_TYPE_SIS : Sis application
' ' CONA_APPLICATION_TYPE_JAVA : Java application
' ' CONA_APPLICATION_TYPE_THEMES : Themes application
' ' CONA_APPLICATION_TYPE_UNKNOWN : Application type is not available
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrUID As String ' Application UID string, used with CONAUninstallApplication function.
Dim dwOptions As Integer ' Reserved for future use. Value is zero.
<MarshalAs(UnmanagedType.LPWStr)> Dim pstrValue As String ' Reserved for future use. Pointer is NULL.
End Structure
'=========================================================
' CONAInstallApplication
'
' Description:
' CONAInstallApplication installs the given application on
' the device. FS's CONACancel function can be used to cancel
' this function. The application file name(s) must be given
' in the CONAPI_APPLICATION_SIS or CONAPI_APPLICATION_JAVA
' structure.
'
' The function also checks the amount of free memory from
' the phone before the installation. If there is not enough
' memory left in the target memory drive, the function fails
' with the error code ECONA_MEMORY_FULL.
'
' If the Application file type is sis, the CONAPI_APPLICATION_SIS
' structure must be used. The iAppicationType parameter's
' value must be CONA_APPLICATION_TYPE_SIS.
'
' If the Application file type is jar, the CONAPI_APPLICATION_JAVA
' structure must be used. The iAppicationType parameter's
' value must be CONA_APPLICATION_TYPE_JAVA.
'
' Parameters:
' hFSHandle [in] File System handle
' iApplicationType [in] Used struct type: CONA_APPLICATION_TYPE_SIS or
' CONA_APPLICATION_TYPE_JAVA
' pApplicationStruct [in] Pointer to CONAPI_APPLICATION_SIS or
' CONAPI_APPLICATION_JAVA struct.
' iOptions [in] Options:
' CONA_DEFAULT_FOLDER: Copies the application to the device's default
' application folder automatically and starts the device's installer
' (if required to do so).Target path or current folder is not used.
' CONA_OVERWRITE: Overwrites the application file if it already
' exists in the target folder.
'
' pstrSourcePath [in] Source folder path on the PC. The value must be NULL,
' if path is given with file name(s) in Application structure.
' pstrTargetPath [in] Target folder.If NULL, current folder is used.
' If CONA_DEFAULT_FOLDER is used,Application will
' be installed to device's default application folder.
'
' Return values:
' CONA_OK
' ECONA_INVALID_HANDLE
' ECONA_INVALID_PARAMETER
' ECONA_CONNECTION_BUSY
' ECONA_CONNECTION_LOST
' ECONA_INVALID_DATA_DEVICE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -