- Timestamp:
- 09/19/14 09:55:27 (10 years ago)
- Location:
- trunk/autoquest-androidmonitor/src/de/ugoe/cs/autoquest/androidmonitor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-androidmonitor/src/de/ugoe/cs/autoquest/androidmonitor/Androidmonitor.java
r1745 r1756 146 146 public void onClick(View v) { 147 147 148 logFile.addEvent(v );148 logFile.addEvent(v, "onClick"); 149 149 150 150 // track information ... -
trunk/autoquest-androidmonitor/src/de/ugoe/cs/autoquest/androidmonitor/AndroidmonitorLogFile.java
r1745 r1756 14 14 import android.view.ViewGroup; 15 15 16 /** 17 * 18 * @author Florian Unger 19 * @version 1.0 20 */ 16 21 public class AndroidmonitorLogFile { 17 22 … … 70 75 71 76 /** 72 * get file name 73 * 74 * @return 77 * <p> 78 * Get file name which is in use. 79 * </p> 80 * 81 * @return filename 82 * 75 83 */ 76 84 public String getName() { … … 86 94 87 95 /** 88 * Query device information. XML format. 89 * 90 * @return 96 * <p> 97 * Query device information. 98 * </p> 99 * 100 * @return XML device information in XML format 91 101 */ 92 102 // should be set … … 133 143 } 134 144 145 /** 146 * <p> 147 * Adds some information of an component of an activity (view) to the file. 148 * </p> 149 * 150 * @param view 151 * view to be logged 152 * @param parentHash 153 * hash of the parent view 154 * @param activityName 155 * name of the activity that is analyzed 156 */ 135 157 public void addComponent(View view, int parentHash, String activityName) { 136 158 XmlSerializer serializer = Xml.newSerializer(); … … 141 163 serializer.setOutput(writer); 142 164 serializer.startTag("", "component"); 143 // TODO use hex string instead of integer number 165 // TODO find a way in that the hash code is unique over time and 166 // target 167 /* 168 * (non-Javadoc) view.getId() seems to be unique over time and 169 * targets but there is a problem. In some cases there is no ID 170 * (value: -1). 171 */ 144 172 serializer.attribute("", "hash", "" + view.hashCode()); 145 173 … … 171 199 serializer.endTag("", "param"); 172 200 201 // TODO add title e.g. android:text="Button" 202 203 // TODO add ancestors @see: 204 // de.ugoe.cs.autoquest.jfcmonitor.JFCComponent#getClassHierarchy() 205 173 206 serializer.endTag("", "component"); 174 207 serializer.endDocument(); … … 192 225 } 193 226 194 public void addEvent(View view) { 227 /** 228 * <p> 229 * Add an event to the log file 230 * </p> 231 * 232 * @param view 233 * the calling view of the listener 234 * @param type 235 * the type of listener e.g. onClick ... 236 */ 237 public void addEvent(View view, String type) { 195 238 196 239 String x = "" + view.getX(); … … 204 247 205 248 serializer.startTag("", "event"); 206 serializer.attribute("", " type", view.getClass().getSimpleName());249 serializer.attribute("", "id", type); 207 250 208 251 serializer.startTag("", "param"); … … 245 288 } 246 289 290 /** 291 * <p> 292 * Writes given information to the file. e.g. previous produced XML 293 * statements. 294 * </p> 295 * 296 * @param data 297 * content to add to the file 298 */ 247 299 private void writeToFile(String data) { 248 300 … … 263 315 264 316 /** 265 * generates the path of an view element 317 * <p> 318 * Generates the path of an view element. 319 * </p> 266 320 * 267 321 * @param view 268 * @return path to the element322 * @return path path to the element 269 323 */ 270 324 private String getViewPath(View view) { … … 273 327 274 328 /** 275 * generates the path of an view element 329 * <p> 330 * Generates the path of an view element. 331 * </p> 276 332 * 277 333 * @param view 278 334 * @param path 279 * @return path to the element335 * @return path path to the element 280 336 */ 281 337 private String getViewPath(View view, String path) {
Note: See TracChangeset
for help on using the changeset viewer.