-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDEVELOPMENT
126 lines (85 loc) · 4.5 KB
/
DEVELOPMENT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
0. Requirements
===============
To check out the code you will need a recent version of git.
To build the project you will need Android SDK r14 or higher and Android SDK
API 14 or higher installed.
1. Getting the code
===================
You can get the code from the code.google.com repository.
Run the command:
$ git clone https://code.google.com/p/voicemail-example-for-android/
This will create a directory named 'voicemail-example-for-android' in your current working directory containing the code.
2. Building
===========
Building can be done using either ant or Eclipse.
2.1 Building with ant
---------------------
First you need to generate the local.properties file. This step only needs to
be done once. You might need to repeat this step if you modify the location of
the SDK.
Run the command:
$ android update project --path .
from the directory containing the code.
After this has been done, you should be able to compile the code using the
command:
$ ant clean debug
which will produce an APK named 'bin/voicemail_example_for_android-debug.apk'.
To install the APK on a device or an emulator, run the following command:
$ ant debug install
2.2 Building with Eclipse
-------------------------
In order to build the code using Eclipse, you will need to install the Android
ADT plug-in for Eclipse.
Open Eclipse and select a workspace. The workspace location cannot be the
directory that contains the code or any directory under it. However, the
eclipse workspace may contain the directory that contains the code.
In Eclipse, select 'File -> Import' from the menu, and then 'Existing Projects
into Workspace' from under 'General' and press 'Next'. In the next dialog,
select the root directory to be the directory that contains the code.
This should show 'voicemail-example-for-android' in the 'Projects' list. Make
sure the checkbox for it is checked and press 'Finish'.
The code should compile without errors. An APK is automatically generated by
Eclipse.
To install the APK you will need to create a run configuration. From the menu,
select 'Run -> Run configurations' and add a new 'Android Application'. Select
'voicemail-example-for-android' as the 'Project' and give a name to your run
configuration. Press 'Apply' and 'Run'. After the first time, you can choose
'Run -> Run' from the menu, press Ctrl+F11 (or the correspond shortcut on your
platform) or use the 'Run' button from the Eclipse toolbar to install and run
the application.
3. Customizing the application
==============================
By default, the application is missing all configuration that is specific to a
voicemail service. In order to configure it for the service you want to use,
you need to make manual modifications to include your parameters to the class
'com.google.android.voicemail.example.spec.ProviderConfigs'. This class
supports having multiple different voicemail services configured, but here we
will consider only the case of a single service.
The service is configured by defining the following parameters:
- providerName: the name of the service, used to support multiple services.
- protocolVersion: the version of the OMTP protocol version to support.
- clientType: the name of the client reported to the network.
- smsDestinationNumber: the phone number to which to send SMS for configuring
the service.
- smsApplicationPort: the port number to which to send SMS for configuring the
service.
- dateFormat: a string representing the format of the date included in SMS sent
from the service.
For ease of testing, it is also possible to set up a default configuration for
the IMAP server with which to communicate. This can be done by modifying
'com.google.android.voicemail.example.util.AccountDetails' to include your IMAP
settings, namely:
- username: the username for the IMAP server.
- password: the plaintext password for the IMAP server.
- serverAddress: the server address of the IMAP server.
- serverPort: the port number of the IMAP server.
- useSsl: whether to USE SSL for connecting to the server.
Normally these need not be included, as they should be configured by means of
SMS by the voicemail service itself, but changing these can be quite useful to
test communication with an IMAP server.
After you have customized the application to match the settings of your
voicemail service you will have to re-build and re-install the application.
4. Contributing changes
=======================
If you make changes, bug fixes, or improvements to the code, please feel free
to contact the project administrator to contribute these changes.