Changeset 4696 for pjproject


Ignore:
Timestamp:
Dec 18, 2013 7:14:54 AM (11 years ago)
Author:
riza
Message:

Re #1716:Added java desktop sample application.

Location:
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/Makefile

    r4691 r4696  
    8080endif 
    8181 
     82MY_APP_JAVA = android/src/$(subst .,/,$(MY_PACKAGE_NAME))/app/MyApp.java 
     83 
    8284.PHONY: all java install uninstall 
    8385 
     
    9799        rm -rf $(LIBPJSUA2_SO) $(OUT_DIR)/* $(MY_PACKAGE_PATH)/*.java $(MY_PACKAGE_PATH)/*.class 
    98100 
    99 java: $(MY_PACKAGE_PATH)/Error.class $(MY_PACKAGE_PATH)/test.class 
     101java: $(MY_PACKAGE_PATH)/Error.class $(MY_PACKAGE_PATH)/test.class $(MY_PACKAGE_PATH)/sample.class 
    100102 
    101103$(MY_PACKAGE_PATH)/Error.class: $(MY_PACKAGE_PATH)/Error.java 
    102         $(MY_JAVAC) -d $(OUT_DIR) $(MY_PACKAGE_PATH)/*.java 
     104        $(MY_JAVAC) -d $(OUT_DIR) $(MY_PACKAGE_PATH)/*.java $(MY_APP_JAVA) 
    103105 
    104106$(MY_PACKAGE_PATH)/test.class: test.java 
    105107        $(MY_JAVAC) -d $(OUT_DIR) -classpath "$(OUT_DIR)" test.java 
     108         
     109$(MY_PACKAGE_PATH)/sample.class: sample.java 
     110        $(MY_JAVAC) -d $(OUT_DIR) -classpath "$(OUT_DIR)" sample.java 
    106111 
    107112test: 
    108113        @# Need to specify classpath and library path, alternatively, they can be set via 
    109114        @# CLASSPATH and java.library.path env settings 
    110         $(MY_JAVA) -cp "$(OUT_DIR);$(MY_PACKAGE_PATH)" -Djava.library.path="$(OUT_DIR)" test 
     115        $(MY_JAVA) -cp "$(OUT_DIR)" -Djava.library.path="$(OUT_DIR)" test 
     116         
     117sample: 
     118        @# Need to specify classpath and library path, alternatively, they can be set via 
     119        @# CLASSPATH and java.library.path env settings 
     120        $(MY_JAVA) -cp "$(OUT_DIR)" -Djava.library.path="$(OUT_DIR)" org.pjsip.pjsua2.app.sample         
    111121 
    112122install: 
  • pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java

    r4691 r4696  
    239239         
    240240        public void init(MyAppObserver obs, String app_dir) { 
     241                init(obs, app_dir, false); 
     242        } 
     243         
     244        public void init(MyAppObserver obs, String app_dir, boolean own_worker_thread) { 
    241245                observer = obs; 
    242246                appDir = app_dir; 
     
    274278                UaConfig ua_cfg = epConfig.getUaConfig(); 
    275279                ua_cfg.setUserAgent("Pjsua2And" + ep.libVersion().getFull()); 
     280                if (own_worker_thread) { 
     281                        ua_cfg.setThreadCnt(0); 
     282                        ua_cfg.setMainThreadOnly(true); 
     283                } 
    276284                 
    277285                /* Init endpoint */ 
Note: See TracChangeset for help on using the changeset viewer.