OOT intermezzo : Viking Persib forum available on Tapatalk :)

by ukung » Wed, 02 Jun 2010 01:07:40 GMT


Sponsored Links
 sori jka sangat oot,, kali aja disini ada bobotoh Persib, jika sedang bosan
jalan2 di tapatalk boleh mampir di forum Persib :)
berhubung sebentar lagi mo piala dunia disana juga ada diskusi sepakbola
dunia

-- 
"



Other Threads

1. Can't make restartPackage() / killBackgroundProcesses() to work

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello.

I'm trying to have restartPackage() work - please note that I'm aware
of all the discussions related to APIs for restarting another
application; I'm not trying to do this in production, but during
functional tests in order to be sure to have the application under
test to start clean every time (without it, I'm currently forced to
run one functional test at a time with adb, which is an annoyance). I
know that restartPackage() has been deprecated in 2.2 and now is
equivalent to   killBackgroundProcesses(), which is perfectly fine for
me.

This is the code I'm trying (from setUp() of an
ActivityInstrumentationTestCase2):

    private void resetApplication()
      {
        logger.info("******** RESTARTING APP");
        final Context context = getInstrumentation().getContext(); //
also tried with getTargetContext(), even though I suppose getContext()
is correct
        final ActivityManager manager =
(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
        manager.restartPackage("it.tidalwave.bluebill.mobile.android");
      }

but I constantly get:

W/ActivityManager( 1280): Permission Denial: restartPackage() from
pid=6014, uid=10071 requires android.permission.RESTART_PACKAGES
I/TestRunner( 6014): failed:
testRun(it.tidalwave.bluebill.mobile.android.test.functional.InsertOneObservationFromScratch)
I/TestRunner( 6014): ----- begin exception -----
I/TestRunner( 6014):
I/TestRunner( 6014): java.lang.SecurityException: Permission Denial:
restartPackage() from pid=6014, uid=10071 requires
android.permission.RESTART_PACKAGES
I/TestRunner( 6014):     at
android.os.Parcel.readException(Parcel.java:1218)
I/TestRunner( 6014):     at
android.os.Parcel.readException(Parcel.java:1206)
I/TestRunner( 6014):     at
android.app.ActivityManagerProxy.restartPackage(ActivityManagerNative.java:2383)
I/TestRunner( 6014):     at
android.app.ActivityManager.restartPackage(ActivityManager.java:910)
I/TestRunner( 6014):     at
it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.resetApplication(ScenarioTestSupport.java:183)
I/TestRunner( 6014):     at
it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.setUp(ScenarioTestSupport.java:87)
I/TestRunner( 6014):     at
it.tidalwave.bluebill.mobile.android.test.functional.ObservationScenarioTestSupport.setUp(ObservationScenarioTestSupport.java:48)
I/TestRunner( 6014):     at
junit.framework.TestCase.runBare(TestCase.java:125)
I/TestRunner( 6014):     at
junit.framework.TestResult$1.protect(TestResult.java:106)
I/TestRunner( 6014):     at
junit.framework.TestResult.runProtected(TestResult.java:124)
I/TestRunner( 6014):     at
junit.framework.TestResult.run(TestResult.java:109)
I/TestRunner( 6014):     at
junit.framework.TestCase.run(TestCase.java:118)
I/TestRunner( 6014):     at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
I/TestRunner( 6014):     at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
I/TestRunner( 6014):     at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
I/TestRunner( 6014):     at
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
I/TestRunner( 6014): ----- end exception -----


Of course I put the required permission in the AndroidManifest.xml:

<?xml version="1.0" encoding="UTF-8"?>
<manifest package="it.tidalwave.bluebill.mobile.android.tests"
android:versionCode="1545"
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionName="0.14.0-SNAPSHOT">
  <uses-sdk android:minSdkVersion="3"/>
  <uses-permission android:name="android.permission.INJECT_EVENT"/>
  <uses-permission android:name="android.permission.RESTART_PACKAGES"/>
  <application android:label="blueBill Mobile Functional Tests">
    <uses-library android:name="android.test.runner"/>
  </application>
  <instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="it.tidalwave.bluebill.mobile.android"
android:label="Tests for blueBill Mobile for Android."/>
</manifest>

The app with tests is signed with the same signature of the app under
test (the debug key). It happens both with the emulator (1.5 and 2.2)
and a Motorola Droid (2.1). Of course the 2.2 with the variant that
the required permission is android.permission.KILL_BACKGROUND_PROCESSES.


Why am I still getting the error? Thanks.

- -- 
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
fabrizio.giud...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxdDr4ACgkQeDweFqgUGxcRFgCgkkyp8VcxyqPCfUkqs7U6HQ5R
s5YAn3V2dETNVU7Lga6vHhf7JQB1WQEm
=kRZ5
-----END PGP SIGNATURE-----

-- 

2. Request different IME for TextEditField

Hello,

Background:
In Vespucci (editor for OpenStreetMap) I have input-fields
for key+value. Many people use Swype but that one is broken
with AutoCompleteTextFields as it only transmits finished words
to the TextField and not the individual characters. Thus the list
of autocompletion-results is never updated during typing and
the dictionary learns lots of incomplete words as users press
"enter" before they are actually finished typing.

Question:
Since I cannot fix Swype and my bug-report will not be adressed
any time soon.  Is it possible to force the usage of another keyboard
(e.g. one the user selected in m app's preferences) for the
text-fields in my app to restore user-experience?


Marcus

-- 

3. How to catch the event when sleep button is pressed?

4. low quality background in 1.1

5. Android Salip BlackBerry dan iPhone

6. Desire NexTSense Official Sense-FroYo 2.

7. Thanks, worked perfectly