Posts

java - i want to transfer data from pc to android phone for which i am using the following code, i am not able to get working directory -

i getting followin error in code: java.io.ioexception: error running exec(). command: ["/adb", -s, 9774d56d682e549c, push, "c:\documents, and, settings\my, documents\other\music\b.wma, ", \sdcard\music] working directory: null environment: null public class transferdata extends activity { private string device_id ; private string = "c:\\documents , settings\\my documents\\other\\music\\b.wma "; private string ="\\sdcard\\music"; private static final string adb_push = "\"" /*+ utility.getworkdir()*/ + file.separator + "adb\" -s %s push \"%s\" %s"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.splash); device_id = secure.getstring(getbasecontext().getcontentresolver(),secure.android_id); push(device_id,from,to); } /** pushes file connected device via adb * @param deviceid device seri...

xaml - Silverlight Usercontrol clr namespace -

i'm building silverlight mvvm app (using galasoft mvvm light template). app has usercontrols. have stumbeld across somthing seems namespace issue. namespaces defined in way: myapp.controls -> user controls myapp.view -> different pages of app (which use user controls) myapp -> namespace of main page (root namespace) this works ok long don't give of usercontrols x:name . x:name defined, build breaks following message: error cs0426: type name 'controls' not exist in type 'myapp.myapp' that realy strange! can resolve issue changing namespace myapp.controls myappcontrols or manipulating generated code, direct reference myapp.controls.mycontrol replaced using myapp.controls , instanciate control mycontrol (however overwritten again, switch desgin view). does know reason strange behaviour? have expected common problem? i think found reason: had resource file name myapp. led generation of class myapp , therefore compiler got confu...

How do I add a column to a JPA entity, and still keep my data? -

during development of jpa application, added field "type" entity. caused application fail start with caused by: exception [eclipselink-4002] (eclipse persistence services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.databaseexception internal exception: java.sql.sqlsyntaxerrorexception: column 't1.type' either not in table in list or appears within join specification , outside scope of join specification or appears in having clause , not in group list. if create or alter table statement 't1.type' not column in target table. error code: -1 during selection. is there way alter table on startup, match current entity definitions? notice when app starts calls create table each table, fails , carries on. in past when i've added fields entities delete database , start again. ok me if want add field entry when developing next release of software, how upgrade clients without losing there data? thanks in advance - phil. genera...

selenium - How to set Proxy Configuration in java code -

i'm trying program in java class start selenium server in case down reason. found here: http://www.testingexcellence.com/how-to-start-selenium-server-with-java-code/ i see if configuration parameters can set using class remotecontrolconfiguration , methods such setport, setlogoutfilename, settimeoutinseconds, ... the problem selenium server connects proxy in way: java -jar selenium-server.jar -dhttp.proxyhost=my.proxy.com -dhttp.proxyport=8080 unfortunately, haven't found how put java code. question is: possible set proxyhost , proxyport values in java? thanks time =) }panacea{ the easiest way set them globally within jvm system.setproperty("http.proxyhost", "yourproxyurl.com"); system.setproperty("http.proxyport", "80"); http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html however affects entire instance of jvm, other outgoing connections try use proxy. that's fine in case, if nee...

Android - Layout Height not updating -

i have scrollview inside have linearlayout. linearlayout has views. ex:- linearlayout height 100. after removed views linearlayout same height 100. how update current height. 0 when no views present. my code: <scrollview android:layout_weight="1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:fillviewport="true"> <linearlayout android:layout_weight="1" android:layout_width="fill_parent" android:orientation="vertical" android:layout_height="wrap_content"> </linearlayout> </scrollview> remove android:layout_weight="1" linearlayout if want 0 height if no views visible.

Is there any way to instantiate a 'Type' in Silverlight XAML? -

it's known silverlight lacks compelling x:type markupextension (markupextension is not supported in silverlight @ all). there dynamic workaround it? what enums ( x:static )? my need have commandparameter set type or enum value, neither of these supported in silverlight! this has done in code-behind. if build custom object exposes property of type type, not "converted" when set via xaml. this limitation prevents creating things custom enumvalueprovider, exposes type property , updates values properties enum values specified enumeration type. having class allow bind combobox or listbox list of enumeration values in xaml. you can create custom typeconverter above type property, work around issue. don't xmlns resolution you'd expect. depending on situation, may enough. here another example , exposes "known" types via properties, can bind to.

multithreading - Android Thread makes the UI blank screen -

i have written thread in application. when thread starts running, ui screen becomes blank. how can avoid this? public class settickertext extends thread { @override public void run() { while(true) { systemclock.sleep(25000); log.i("map", "after wait"); } } it's going (don't have compiler near me): new settickertext().start() essentially, when tell thread object start, spins new thread, invokes run you. you're doing calling run ui thread, other function, it's blocking ui thread returning