00001 /* 00002 * OpenMobileIS - a free Java Framework for mobile applications 00003 * 00004 * Copyright (C) 2002 Philippe Delrieu. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this library; if not, write to the Free 00018 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 * 00020 * Philippe Delrieu kept the rigth to distribute all code Copyrighted by philippe Delrieu 00021 * under other licence term even commercial one. 00022 * 00023 * Modifications : 00024 * 2002 Creation P.Delrieu 00025 * 00026 */ 00027 00028 package org.openmobileis.embedded.util; 00029 00038 public class SystemAPI { 00039 00045 public static native int execProgramAndWait(String path, String args); 00046 00052 public static native int execProgram (String path, String args); 00053 00058 public static long currentTimeInMillis() { 00059 return System.currentTimeMillis(); 00060 } 00061 00062 public static void main (String[] args) { 00063 try { 00064 int i = SystemAPI.execProgramAndWait("\\Windows\\calc.exe",""); 00065 System.out.println(i); 00066 i = SystemAPI.execProgram("\\Windows\\calendar.exe",""); 00067 System.out.println(i); 00068 } catch (Exception e) { 00069 e.printStackTrace(); 00070 } 00071 } 00072 }