Search Results

Search found 34 results on 2 pages for 'parcel'.

Page 1/2 | 1 2  | Next Page >

  • How to use Parcel in Android?

    - by Mike
    I'm trying to use Parcel to write and then read back a Parcelable. For some reason, when I read the object back from the file, it's coming back as null. public void testFoo() { final Foo orig = new Foo("blah blah"); // Wrote orig to a parcel and then byte array final Parcel p1 = Parcel.obtain(); p1.writeValue(orig); final byte[] bytes = p1.marshall(); // Check to make sure that the byte array seems to contain a Parcelable assertEquals(4, bytes[0]); // Parcel.VAL_PARCELABLE // Unmarshall a Foo from that byte array final Parcel p2 = Parcel.obtain(); p2.unmarshall(bytes, 0, bytes.length); final Foo result = (Foo) p2.readValue(Foo.class.getClassLoader()); assertNotNull(result); // FAIL assertEquals( orig.str, result.str ); } protected static class Foo implements Parcelable { protected static final Parcelable.Creator<Foo> CREATOR = new Parcelable.Creator<Foo>() { public Foo createFromParcel(Parcel source) { final Foo f = new Foo(); f.str = (String) source.readValue(Foo.class.getClassLoader()); return f; } public Foo[] newArray(int size) { throw new UnsupportedOperationException(); } }; public String str; public Foo() { } public Foo( String s ) { str = s; } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int ignored) { dest.writeValue(str); } } What am I missing? UPDATE: To simplify the test I've removed the reading and writing of files in my original example.

    Read the article

  • Introducing the Oracle Parcel Service&ndash;Example/Reference Application

    - by Jeffrey West
    Over the last few weeks the product management team has been working on a webcast series that is airing in EMEA.  It is a 5-episode series where we talk about different features of WebLogic and show how to build applications that take advantage of these features.  Each session is focused at a different layer of the technology stack, and you can find the schedule below. The application we are building in this series is named the ‘Oracle Parcel Service’.  It is an example application and not a product of Oracle by any stretch of the imagination.  Over the next few weeks we will be finalizing the code and will be releasing it for you to check out.  For updates, request membership to the Oracle Parcel Service project on SampleCode.oracle.com: https://www.samplecode.oracle.com/sf/projects/oracle-parcel-svc/. Here are some of the key features that we are highlighting: JPA 2.0 (new in WebLogic 10.3.4) with EclipseLink Coherence TopLink Grid Level 2 cache for JPA JAX-RS (new in WebLogic 10.3.4) 1.0 for RESTful services Lightweight JQuery Web UI for consuming RESTful services JSF 2.0 (new in WebLogic 10.3.4) utilizing PrimeFaces EJB 3.0 Spring-WS Web Services JAX-WS Web Services Spring MDP’s for Event Driven Architectures Java MDB’s for Event Driven Architectures Partitioned Distributed Topics for Event Driven Architectures   Accessing the Code on SampleCode.Oracle.com You will need to log in using your Oracle.com username and password.  If you have not created an account, you will need to do so.  It’s a simple one-page form and we don’t bother you with too many emails.   Please join the project to be kept up to date on changes to the code and new projects.  Joining the project is not required, but very much appreciated. Once you have signed in you should see an icon for accessing the Source Code via Subversion.  You can also download a zip file containing the code.

    Read the article

  • PHP / C++ space calculations for parcel packing

    - by Andrew Willis
    I am working on a shopping cart project which requires a 'postage calculator' based on items that the person has in their cart. Obviously I will be storing the item's dimensions incl. weight and padding in a database and will also store the parcel (box) size and weight that the items will go in to, incl. box padding. Figuring the weight of the parcels will be easy but I was wondering how to go about figuring how to pack the box via PHP, that is, I would like the code to 'play tetris' with the items to make sure they get the best possible fit, giving accurate postage costs. Does anybody have any ideas on how best to achieve this or does anybody know of a PHP Class or function that can do this? EDIT: When I said 'best possible fit' maybe I was being optimistic! Having the script try every possible combination of package distribution within the parcel would be over the top, however I could improve the speed by writing the algoritm in C++ and running the program in PHP when the user 'checks out', the return value being an array with the parcel size and weight (which are all that are needed to calculate postage costs)

    Read the article

  • Is context:annotation-config an alternative to @AutoWired?

    - by Antacid
    Is it correct that I can put context:annotation-config in my XML config and it will automatically inject the bean class without needing any annotations? So instead of using these annotation types: public class Mailman { private String name; @Autowired private Parcel Parcel; public Mailman(String name) { this.name = name; } @Autowired public void setParcel(Parcel Parcel) { this.Parcel = Parcel; } @Autowired public void directionsToParcel(Parcel Parcel) { this.Parcel = Parcel; } } I would just need to write this: <beans ... > <bean id="mailMan" class="MailMan"> <constructor-arg value="John Doe"/> </bean> <bean id="parcel" class="Parcel" /> <context:annotation-config /> </beans> and then my MailMan class would look a lot simpler without the need for annotations: public class Mailman { private String name; private Parcel Parcel; public Mailman(String name) { this.name = name; } }

    Read the article

  • Android Parcelable create array

    - by Ozik Abdullaev
    In background i parse JSON, and then in this background i send Json to parcelable And in Parcelable i writestring with JSONObject.optString how i can write ArrayList? List<Row> result = new ArrayList<Row>(array.length()); for (int i = 0; i < array.length(); i++) { result.add(new Row(array.optJSONObject(i))); } Parcelable.java public Row(JSONObject from) { thumb = from.optString(TAG_THUMBNAILS); bigImage = from.optString(TAG_BIG_IMAGE); author = from.optString(TAG_AUTHOR); description = from.optString(TAG_DESCRIPTION); date = from.optString(TAG_DATE); } public Row(Parcel parcel) { thumb = parcel.readString(); bigImage = parcel.readString(); author = parcel.readString(); description = parcel.readString(); date = parcel.readString(); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(thumb); parcel.writeString(bigImage); parcel.writeString(author); parcel.writeString(description); parcel.writeString(date); }

    Read the article

  • Exception when creating an activity: Could not select item Parcel unable to marshal value

    - by user341652
    Hi, I am trying to call an Activity from another instance of the activity. The code is supposed to be a simple file browser (part of a larger application). I am using a ListActivity, and when an item (such as a folder) is selected, it is supposed to open it up in the new Activity. I have a feeling it is a problem with the AndroidManifest (which just has the basic tag). Any assistance would be appreciated. Thanks, Steve

    Read the article

  • Translate SQL to OCL ?

    - by Roland Bengtsson
    I have a piece of SQL that I want to translate to OCL. I'm not good at SQL so I want to increase maintainability by this. We are using Interbase 2009, Delphi 2007 with Bold and modeldriven development. Now my hope is that someone here both speaks good SQL and OCL :-) The original SQL: Select Bold_Id, MessageId, ScaniaId, MessageType, MessageTime, Cancellation, ChassieNumber, UserFriendlyFormat, ReceivingOwner, Invalidated, InvalidationReason, (Select Parcel.MCurrentStates From Parcel Where ScaniaEdiSolMessage.ReceivingOwner = Parcel.Bold_Id) as ParcelState From ScaniaEdiSolMessage Where MessageType = 'IFTMBP' and not Exists (Select * From ScaniaEdiSolMessage EdiSolMsg Where EdiSolMsg.ChassieNumber = ScaniaEdiSolMessage.ChassieNumber and EdiSolMsg.ShipFromFinland = ScaniaEdiSolMessage.ShipFromFinland and EdiSolMsg.MessageType = 'IFTMBF') and invalidated = 0 Order By MessageTime desc After a small simplification: Select Bold_Id, (Select Parcel.MCurrentStates From Parcel where ScaniaEdiSolMessage.ReceivingOwner = Parcel.Bold_Id) From ScaniaEdiSolMessage Where MessageType = 'IFTMBP' and not Exists (Select * From ScaniaEdiSolMessage EdiSolMsg Where EdiSolMsg.ChassieNumber = ScaniaEdiSolMessage.ChassieNumber and EdiSolMsg.ShipFromFinland = ScaniaEdiSolMessage.ShipFromFinland and EdiSolMsg.MessageType = 'IFTMBF') and invalidated = 0 NOTE: There are 2 cases for MessageType, 'IFTMBP' and 'IFTMBF'. So the table to be listed is ScaniaEdiSolMessage. It has attributes like: MessageType: String ChassiNumber: String ShipFromFinland: Boolean Invalidated: Boolean It has also a link to table Parcel named ReceivingOwner with BoldId as key. So it seems like it list all rows of ScaniaEdiSolMessage and then have a subquery that also list all rows of ScaniaEdiSolMessage and name it EdiSolMsg. The it exclude almost all rows. In fact the query above give one hit from 28000 records. In OCL it is easy to list all instances: ScaniaEdiSolMessage.allinstances Also easy to filter rows by select for example: ScaniaEdiSolMessage.allinstances->select(shipFromFinland and not invalidated) But I do not understand how I should make a OCL to match the SQL above.

    Read the article

  • android service onBind SecurityException

    - by Metalex
    I don't know why but in some devices my service isn't allowed to bind. java.lang.RuntimeException: Unable to create application mypackage.MyApplication: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:2720) at android.app.ContextImpl.bindService(ContextImpl.java:1431) at android.app.ContextImpl.bindService(ContextImpl.java:1407) at android.content.ContextWrapper.bindService(ContextWrapper.java:473) at mypackage.MyApplication.openService(MyApplication.java:151) at mypackage.MyApplication.onCreate(MyApplication.java:110) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) ... 10 more java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41680e78 (pid=16805) when binding service Intent { cmp=mypackage/.MyService } at android.os.Parcel.readException(Parcel.java:1425) at android.os.Parcel.readException(Parcel.java:1379) at android.app.ActivityManagerProxy.bindService(ActivityManagerNative.java:2720) at android.app.ContextImpl.bindService(ContextImpl.java:1431) at android.app.ContextImpl.bindService(ContextImpl.java:1407) at android.content.ContextWrapper.bindService(ContextWrapper.java:473) at mypackage.MyApplication.openService(MyApplication.java:151) at mypackage.MyApplication.onCreate(MyApplication.java:110) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method) Code from MyApplication: @Override public void onCreate() { super.onCreate(); openService(); } public void openService() { Intent service = new Intent(this, MyService.class); mConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { mService = IMyService.Stub.asInterface(service); if (mListener != null) { mListener.onServiceStarted(mService); } } @Override public void onServiceDisconnected(ComponentName cn) { mService = null; } }; bindService(service, mConnection, Context.BIND_AUTO_CREATE); // 151 line } Please help me! Thank you!

    Read the article

  • Does an Intent's extras still get flattened into a Parcel even if the new activity is being started

    - by Neil Traft
    I was wondering... So if you start a new activity via an intent, the intent has to be serialized and deserialized because you may have to send the intent to a separate VM instance via IPC. But what if the PackageManager knows that your new activity will be created on the current task? It seems like a reasonably Googly optimization would be not to serialize the intent at all, since it's all happening inside the same VM. But then again, you can't just allow the new activity to use the same instance of each parcelable, because any changes made by the new activity would show up in the old activity and the programmer might not be expecting this. So, is this optimization being done? Or do the extras always get marshalled and unmarshalled, no matter what?

    Read the article

  • Proguard and two projects using the same android library. broadcasting. ClassNotFoundException

    - by trololo
    The problem:I have got 2 apps. The interact with each other via broadcasting. I have parcelable class in the android library (they send content of class in the library). So after using Proguard I have got ClassNotFondException. How to solve it? 07-03 02:13:51.832: E/AndroidRuntime(6801): FATAL EXCEPTION: main 07-03 02:13:51.832: E/AndroidRuntime(6801): java.lang.RuntimeException: Unable to start receiver <appname>.<name>.ar.free.BRMain: java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = <appname>.a.a.b) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2277) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.app.ActivityThread.access$1500(ActivityThread.java:140) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Handler.dispatchMessage(Handler.java:99) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Looper.loop(Looper.java:137) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.app.ActivityThread.main(ActivityThread.java:4898) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.reflect.Method.invokeNative(Native Method) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.reflect.Method.invoke(Method.java:511) 07-03 02:13:51.832: E/AndroidRuntime(6801): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006) 07-03 02:13:51.832: E/AndroidRuntime(6801): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773) 07-03 02:13:51.832: E/AndroidRuntime(6801): at dalvik.system.NativeStart.main(Native Method) 07-03 02:13:51.832: E/AndroidRuntime(6801): Caused by: java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = <appname>.a.a.b) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Parcel.readSerializable(Parcel.java:2148) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Parcel.readValue(Parcel.java:2016) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Parcel.readMapInternal(Parcel.java:2226) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Bundle.unparcel(Bundle.java:223) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Bundle.getInt(Bundle.java:922) 07-03 02:13:51.832: E/AndroidRuntime(6801): at <appname>.<name>.ar.free.BRMain.onReceive(BRMain.java:35) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2270) 07-03 02:13:51.832: E/AndroidRuntime(6801): ... 10 more 07-03 02:13:51.832: E/AndroidRuntime(6801): Caused by: java.lang.ClassNotFoundException: <appname>.a.a.b 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.Class.classForName(Native Method) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.Class.forName(Class.java:217) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2301) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1660) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:683) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1803) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:787) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2003) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1960) 07-03 02:13:51.832: E/AndroidRuntime(6801): at android.os.Parcel.readSerializable(Parcel.java:2142) 07-03 02:13:51.832: E/AndroidRuntime(6801): ... 16 more 07-03 02:13:51.832: E/AndroidRuntime(6801): Caused by: java.lang.NoClassDefFoundError: <appname>/a/a/b 07-03 02:13:51.832: E/AndroidRuntime(6801): ... 26 more 07-03 02:13:51.832: E/AndroidRuntime(6801): Caused by: java.lang.ClassNotFoundException: <appname>.a.a.b 07-03 02:13:51.832: E/AndroidRuntime(6801): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 07-03 02:13:51.832: E/AndroidRuntime(6801): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 07-03 02:13:51.832: E/AndroidRuntime(6801): ... 26 more

    Read the article

  • android throw InvocationTargetException,How to modify the error

    - by fonter
    ActivityManager am = (ActivityManager)this.getSystemService(this.ACTIVITY_SERVICE); try { clearMethod = am.getClass() .getMethod("clearApplicationUserData", String.class, IPackageDataObserver.class); } catch (Exception e) { Log.e("Error", "Android Error",e); clearMethod = null; } if(clearMethod!=null){ try { clearMethod.invoke(am,"com.android.browser",new ClearUserDataObserver()); } catch (Exception e) { Log.e("Error", "Android Exception",e); } } Exception 05-26 08:34:13.056: ERROR/Error(739): java.lang.reflect.InvocationTargetException 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityManager.clearApplicationUserData(ActivityManager.java:475) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invokeNative(Native Method) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invoke(Method.java:521) 05-26 08:34:13.056: ERROR/Error(739): at com.iwidsets.clear.manager.AndClear.onCreate(AndClear.java:34) 05-26 08:34:13.056: ERROR/Error(739): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Handler.dispatchMessage(Handler.java:99) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Looper.loop(Looper.java:123) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invokeNative(Native Method) 05-26 08:34:13.056: ERROR/Error(739): at java.lang.reflect.Method.invoke(Method.java:521) 05-26 08:34:13.056: ERROR/Error(739): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 05-26 08:34:13.056: ERROR/Error(739): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-26 08:34:13.056: ERROR/Error(739): at dalvik.system.NativeStart.main(Native Method) 05-26 08:34:13.056: ERROR/Error(739): Caused by: java.lang.SecurityException: 739 does not have permission:android.permission.CLEAR_APP_USER_DATA to clear datafor process:com.android.browser 05-26 08:34:13.056: ERROR/Error(739): at android.os.Parcel.readException(Parcel.java:1218) 05-26 08:34:13.056: ERROR/Error(739): at android.os.Parcel.readException(Parcel.java:1206) 05-26 08:34:13.056: ERROR/Error(739): at android.app.ActivityManagerProxy.clearApplicationUserData(ActivityManagerNative.java:2016) 05-26 08:34:13.056: ERROR/Error(739): ... 17 more

    Read the article

  • Android App to call a number on button click

    - by FosterZ
    hey guys this is my 1st android app(learning), so i want to call a number given in the textbox but i'm getting error as "The application 'xyz'(process com.adroid) has stoped unexpectedly".. following the code i have done so far... where m doing wrong ?? EditText txtPhn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button callButton = (Button)findViewById(R.id.btnCall); txtPhn = (EditText)findViewById(R.id.txtPhnNumber); callButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:"+txtPhn.getText().toString())); startActivity(callIntent); } catch (ActivityNotFoundException activityException) { Log.e("Calling a Phone Number", "Call failed", activityException); } } }); } EDITED LogCat 03-09 11:23:25.874: ERROR/AndroidRuntime(370): FATAL EXCEPTION: main 03-09 11:23:25.874: ERROR/AndroidRuntime(370): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{40738d70 370:org.krish.android/10034} (pid=370, uid=10034) requires android.permission.CALL_PHONE 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1322) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1276) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1351) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivityForResult(Activity.java:2827) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivity(Activity.java:2933) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at org.krish.android.caller$1.onClick(caller.java:29) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View.performClick(View.java:2485) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View$PerformClick.run(View.java:9080) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.handleCallback(Handler.java:587) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.dispatchMessage(Handler.java:92) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Looper.loop(Looper.java:123) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invokeNative(Native Method) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invoke(Method.java:507) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Android: Send arbitrary objects within Activities?

    - by Sebastian
    I have read some question here but I didn't find a solution. I have read about Parcelable, Intents, and sharing specific data within Activities from the android dev docs (both dev guide and reference). Here's the scenario: I have one ListActivity that fills in an object parsing an xml file, it shows a list of values, and when clicked I want to return the object that represents the item clicked to the activity that has called it, for then, call another activity with this object. I read on how to implement Parcelable but seems not being the way. Implementing Parcelable receives a Parcel for the constructor and then reads the values from it (or at least that was what I understood). This makes no sense for me and I can't see how to implement basing on that issue. I build the object parsing the xml file, not having a Parcel. I appreciate some clarifications on this, regards.

    Read the article

  • Trying to get Package Version Information to display in an "About" message.

    - by user313135
    Hello, I have been struggling with getting the versionName for a running application from the PackageInfo Object type. I have constructed a Parcelable Interface with all of the fields associated with the PackageInfo Object type. The primary input for that interface method is a Parcel object. I cannot seem to figure out how to correctly associate these Parcelable, Parcel, and PackageInfo objects. Is there any sample code out there that I can look at? Doesn't seem like it should be that difficult but it seems to be stumping me. Thanks Jazz

    Read the article

  • Fatal Exception : AsyncTask #1

    - by Nadirah Ibtisam
    help help..huu Im having a problem here..seems there was no error in codes..but when I run it...and click button to view map consist routing the map..It appers to be close all of sudden..why is that? Please help me friends.. Im developing an app to read my current location and creating route to A position.. here are the codes: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); onNewIntent(getIntent()); Drawable marker = getResources().getDrawable(R.drawable.marker); Drawable marked_places = getResources().getDrawable(R.drawable.feringgi_map); mymap = (MapView)findViewById(R.id.mymap); controller = mymap.getController(); // extract MapView from layout mymap.getController().setZoom(15); mymap.setBuiltInZoomControls(true); mymap.setSatellite(false); // create an overlay that shows our current location myLocationOverlay = new MyLocationOverlay(this, mymap); // add this overlay to the MapView and refresh it mymap.getOverlays().add(myLocationOverlay); mymap.postInvalidate(); myLocationOverlay.runOnFirstFix(new Runnable() { @Override public void run() { controller.setZoom(10); controller.animateTo(myLocationOverlay.getMyLocation()); } }); zoomToMyLocation(); switch(selecteditem) { case 0: switch(selectedsubitem){ case 0://Place A locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this); Location location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location !=null) { loc=location; } GeoPoint destination = getPoint(3.144341, 101.69541800000002); new BackgroundTask(this, loc, destination).execute(); break; } } class BackgroundTask extends AsyncTask<Void, Void, Void> { private Location location; private GeoPoint dest; private Route route; private Activity activity; private ProgressDialog dialog; private RouteOverlay routeOverlay; public BackgroundTask(Activity activity, Location loc, GeoPoint dest) { location=loc; this.dest=dest; this.activity=activity; dialog = new ProgressDialog(activity); } @Override protected void onPreExecute() { dialog.setCancelable(false); dialog.setTitle("Loading..."); dialog.setMessage("Calculating Route..."); dialog.setButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(final DialogInterface dialog, final int id) { cancel(true); MyMap.this.finish(); }}); dialog.show(); } protected Void doInBackground(Void... params) { if(isNetworkAvailable()) { if(haveInternet()) { try{ route = directions(new GeoPoint((int)(location.getLatitude()*1.0E6),(int)(location.getLongitude()*1.0E6)), dest); } catch (NullPointerException e){ } } else { return null; } } else { return null; } return null; } And this is the log cat (updated).. : 12-10 12:21:15.527: E/AndroidRuntime(10146): FATAL EXCEPTION: AsyncTask #1 12-10 12:21:15.527: E/AndroidRuntime(10146): java.lang.RuntimeException: An error occured while executing doInBackground() 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.os.AsyncTask$3.done(AsyncTask.java:278) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.FutureTask.setException(FutureTask.java:124) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.lang.Thread.run(Thread.java:856) 12-10 12:21:15.527: E/AndroidRuntime(10146): Caused by: java.lang.SecurityException: ConnectivityService: Neither user 10228 nor current process has android.permission.ACCESS_NETWORK_STATE. 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.os.Parcel.readException(Parcel.java:1327) 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.os.Parcel.readException(Parcel.java:1281) 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:728) 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:378) 12-10 12:21:15.527: E/AndroidRuntime(10146): at com.madcatworld.testtesttest.MyMap$BackgroundTask.isNetworkAvailable(MyMap.java:488) 12-10 12:21:15.527: E/AndroidRuntime(10146): at com.madcatworld.testtesttest.MyMap$BackgroundTask.doInBackground(MyMap.java:411) 12-10 12:21:15.527: E/AndroidRuntime(10146): at com.madcatworld.testtesttest.MyMap$BackgroundTask.doInBackground(MyMap.java:1) 12-10 12:21:15.527: E/AndroidRuntime(10146): at android.os.AsyncTask$2.call(AsyncTask.java:264) 12-10 12:21:15.527: E/AndroidRuntime(10146): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 12-10 12:21:15.527: E/AndroidRuntime(10146): ... 5 more This is my manifest file: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.madcatworld.testtesttest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <com.google.android.maps.MapView android:id="@+id/mymap" android:clickable="true" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="XXXX" /> <activity android:theme="@style/StyledIndicators" android:name=".MainTest" android:label="@string/title_activity_main" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <uses-library android:name="com.google.android.maps"/> <activity android:name="A" android:screenOrientation="portrait"></activity> <activity android:name="B" android:screenOrientation="portrait"></activity> <activity android:name="C" android:screenOrientation="portrait"></activity> </application> </manifest> For your information, I already put ACCESS_NETWORK_STATE in my manifest.. Can u discover what cause the error? No error in code..but it failed to review my route map..:( Thanks Friends

    Read the article

  • Android passing an arraylist back to parent activity

    - by Nicklas O
    Hi there. I've been searching for a simple example of this with no luck. In my android application I have two activities: 1. The main activity which is launched at startup 2. A second activity which is launched by pressing a button on the main activty. When the second activity is finished (by pressing a button) I want it to send back an ArrayList of type MyObject to the main activity and close itself, which the main activity can then do whatever with it. How would I go about achieving this? I have been trying a few things but it is crashing my application when I start the second activity. When the user presses button to launch second activity: Intent i = new Intent(MainActivity.this, secondactivity.class); startActivityForResult(i, 1); The array which is bundled back after pressing a button on the second activity: Intent intent= getIntent(); Bundle b = new Bundle(); b.putParcelableArrayList("myarraylist", mylist); intent.putExtras(b); setResult(RESULT_OK, intent); finish(); And finally a listener on the main activity (although I'm not sure of 100% when this code launches...) protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(resultCode==RESULT_OK && requestCode==1){ Bundle extras = data.getExtras(); final ArrayList<MyObject> mylist = extras.getParcelableArrayList("myarraylist"); Toast.makeText(MainActivity.this, mylist.get(0).getName(), Toast.LENGTH_SHORT).show(); } } Any ideas where I am going wrong? The onActivityResult() seems to be crashing my application. EDIT: This is my class MyObject, its called plan and has a name and an id import android.os.Parcel; import android.os.Parcelable; public class Plan implements Parcelable{ private String name; private String id; public Plan(){ } public Plan(String name, String id){ this.name = name; this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String toString(){ return "Plan ID: " + id + " Plan Name: " + name; } @Override public int describeContents() { // TODO Auto-generated method stub return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(id); dest.writeString(name); } public static final Parcelable.Creator<Plan> CREATOR = new Parcelable.Creator<Plan>() { public Plan createFromParcel(Parcel in) { return new Plan(); } @Override public Plan[] newArray(int size) { // TODO Auto-generated method stub return new Plan[size]; } }; } This is my logcat E/AndroidRuntime( 293): java.lang.RuntimeException: Unable to instantiate activ ity ComponentInfo{com.daniel.android.groupproject/com.me.android.projec t.secondactivity}: java.lang.NullPointerException E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2417) E/AndroidRuntime( 293): at android.app.ActivityThread.handleLaunchActivi ty(ActivityThread.java:2512) E/AndroidRuntime( 293): at android.app.ActivityThread.access$2200(Activi tyThread.java:119) E/AndroidRuntime( 293): at android.app.ActivityThread$H.handleMessage(Ac tivityThread.java:1863) E/AndroidRuntime( 293): at android.os.Handler.dispatchMessage(Handler.ja va:99) E/AndroidRuntime( 293): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 293): at android.app.ActivityThread.main(ActivityThrea d.java:4363) E/AndroidRuntime( 293): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 293): at java.lang.reflect.Method.invoke(Method.java:5 21) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit$MethodAndA rgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit.main(Zygot eInit.java:618) E/AndroidRuntime( 293): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 293): Caused by: java.lang.NullPointerException E/AndroidRuntime( 293): at com.daniel.android.groupproject.login.<init>( login.java:51) E/AndroidRuntime( 293): at java.lang.Class.newInstanceImpl(Native Method ) E/AndroidRuntime( 293): at java.lang.Class.newInstance(Class.java:1479) E/AndroidRuntime( 293): at android.app.Instrumentation.newActivity(Instr umentation.java:1021) E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2409) E/AndroidRuntime( 293): ... 11 more

    Read the article

  • Obtaining XML from U.S. Postal Service (USPS) rate calculator API with PHP

    - by Chris F
    hoping somebody here can help me. I'm attempting to pull an XML page from the U.S. Postal Service (USPS) rate calculator, using PHP. Here is the code I am using (with my API login and password replaced of course): <? $api = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=<RateV4Request ". "USERID=\"MYUSERID\" PASSWORD=\"MYPASSWORD\"><Revision/><Package ID=\"1ST\">". "<Service>FIRST CLASS</Service><FirstClassMailType>PARCEL</FirstClassMailType>". "<ZipOrigination>12345</ZipOrigination><ZipDestination>54321</ZipDestination>". "<Pounds>0</Pounds><Ounces>9</Ounces><Container/><Size>REGULAR</Size></Package></RateV4Request>"; $xml_string = file_get_contents($api); $xml = simplexml_load_string($xml_string); ?> Pretty straightforward. However it never returns anything. I can paste the URL directly into my browser's address bar: http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML=<RateV4RequestUSERID="MYUSERID" PASSWORD="MYPASSWORD"><Revision/><Package ID="1ST"><Service>FIRST CLASS</Service><FirstClassMailType>PARCEL</FirstClassMailType><ZipOrigination>12345</ZipOrigination><ZipDestination>54321</ZipDestination><Pounds>0</Pounds><Ounces>9</Ounces><Container/><Size>REGULAR</Size></Package></RateV4Request> And it returns the XML I need, so I know the URL is valid. But I cannot seem to capture it using PHP. Any help would be tremendously appreciated. Thanks in advance.

    Read the article

  • Cloud to On-Premise Connectivity Patterns

    - by Rajesh Raheja
    Do you have a requirement to convert an Opportunity in Salesforce.com to an Order/Quote in Oracle E-Business Suite? Or maybe you want the creation of an Oracle RightNow Incident to trigger an on-premise Oracle E-Business Suite Service Request creation for RMA and Field Scheduling? If so, read on. In a previous blog post, I discussed integrating TO cloud applications, however the use cases above are the reverse i.e. receiving data FROM cloud applications (SaaS) TO on-premise applications/databases that sit behind a firewall. Oracle SOA Suite is assumed to be on-premise with with Oracle Service Bus as the mediation and virtualization layer. The main considerations for the patterns are are security i.e. shielding enterprise resources; and scalability i.e. minimizing firewall latency. Let me use an analogy to help visualize the patterns: the on-premise system is your home - with your most valuable possessions - and the SaaS app is your favorite on-line store which regularly ships (inbound calls) various types of parcels/items (message types/service operations). You need the items at home (on-premise) but want to safe guard against misguided elements of society (internet threats) who may masquerade as postal workers and vandalize property (denial of service?). Let's look at the patterns. Pattern: Pull from Cloud The on-premise system polls from the SaaS apps and picks up the message instead of having it delivered. This may be done using Oracle RightNow Object Query Language or SOAP APIs. This is particularly suited for certain integration approaches wherein messages are trickling in, can be centralized and batched e.g. retrieving event notifications on an hourly schedule from the Oracle Messaging Service. To compare this pattern with the home analogy, you are avoiding any deliveries to your home and instead go to the post office/UPS/Fedex store to pick up your parcel. Every time. Pros: On-premise assets not exposed to the Internet, firewall issues avoided by only initiating outbound connections Cons: Polling mechanisms may affect performance, may not satisfy near real-time requirements Pattern: Open Firewall Ports The on-premise system exposes the web services that needs to be invoked by the cloud application. This requires opening up firewall ports, routing calls to the appropriate internal services behind the firewall. Fusion Applications uses this pattern, and auto-provisions the services on the various virtual hosts to secure the topology. This works well for service integration, but may not suffice for large volume data integration. Using the home analogy, you have now decided to receive parcels instead of going to the post office every time. A door mail slot cut out allows the postman can drop small parcels, but there is still concern about cutting new holes for larger packages. Pros: optimal pattern for near real-time needs, simpler administration once the service is provisioned Cons: Needs firewall ports to be opened up for new services, may not suffice for batch integration requiring direct database access Pattern: Virtual Private Networking The on-premise network is "extended" to the cloud (or an intermediary on-demand / managed service offering) using Virtual Private Networking (VPN) so that messages are delivered to the on-premise system in a trusted channel. Using the home analogy, you entrust a set of keys with a neighbor or property manager who receives the packages, and then drops it inside your home. Pros: Individual firewall ports don't need to be opened, more suited for high scalability needs, can support large volume data integration, easier management of one connection vs a multitude of open ports Cons: VPN setup, specific hardware support, requires cloud provider to support virtual private computing Pattern: Reverse Proxy / API Gateway The on-premise system uses a reverse proxy "API gateway" software on the DMZ to receive messages. The reverse proxy can be implemented using various mechanisms e.g. Oracle API Gateway provides firewall and proxy services along with comprehensive security, auditing, throttling benefits. If a firewall already exists, then Oracle Service Bus or Oracle HTTP Server virtual hosts can provide reverse proxy implementations on the DMZ. Custom built implementations are also possible if specific functionality (such as message store-n-forward) is needed. In the home analogy, this pattern sits in between cutting mail slots and handing over keys. Instead, you install (and maintain) a mailbox in your home premises outside your door. The post office delivers the parcels in your mailbox, from where you can securely retrieve it. Pros: Very secure, very flexible Cons: Introduces a new software component, needs DMZ deployment and management Pattern: On-Premise Agent (Tunneling) A light weight "agent" software sits behind the firewall and initiates the communication with the cloud, thereby avoiding firewall issues. It then maintains a bi-directional connection either with pull or push based approaches using (or abusing, depending on your viewpoint) the HTTP protocol. Programming protocols such as Comet, WebSockets, HTTP CONNECT, HTTP SSH Tunneling etc. are possible implementation options. In the home analogy, a resident receives the parcel from the postal worker by opening the door, however you still take precautions with chain locks and package inspections. Pros: Light weight software, IT doesn't need to setup anything Cons: May bypass critical firewall checks e.g. virus scans, separate software download, proliferation of non-IT managed software Conclusion The patterns above are some of the most commonly encountered ones for cloud to on-premise integration. Selecting the right pattern for your project involves looking at your scalability needs, security restrictions, sync vs asynchronous implementation, near real-time vs batch expectations, cloud provider capabilities, budget, and more. In some cases, the basic "Pull from Cloud" may be acceptable, whereas in others, an extensive VPN topology may be well justified. For more details on the Oracle cloud integration strategy, download this white paper.

    Read the article

  • Cloud to On-Premise Connectivity Patterns

    - by Rajesh Raheja
    Do you have a requirement to convert an Opportunity in Salesforce.com to an Order/Quote in Oracle E-Business Suite? Or maybe you want the creation of an Oracle RightNow Incident to trigger an on-premise Oracle E-Business Suite Service Request creation for RMA and Field Scheduling? If so, read on. In a previous blog post, I discussed integrating TO cloud applications, however the use cases above are the reverse i.e. receiving data FROM cloud applications (SaaS) TO on-premise applications/databases that sit behind a firewall. Oracle SOA Suite is assumed to be on-premise with with Oracle Service Bus as the mediation and virtualization layer. The main considerations for the patterns are are security i.e. shielding enterprise resources; and scalability i.e. minimizing firewall latency. Let me use an analogy to help visualize the patterns: the on-premise system is your home - with your most valuable possessions - and the SaaS app is your favorite on-line store which regularly ships (inbound calls) various types of parcels/items (message types/service operations). You need the items at home (on-premise) but want to safe guard against misguided elements of society (internet threats) who may masquerade as postal workers and vandalize property (denial of service?). Let's look at the patterns. Pattern: Pull from Cloud The on-premise system polls from the SaaS apps and picks up the message instead of having it delivered. This may be done using Oracle RightNow Object Query Language or SOAP APIs. This is particularly suited for certain integration approaches wherein messages are trickling in, can be centralized and batched e.g. retrieving event notifications on an hourly schedule from the Oracle Messaging Service. To compare this pattern with the home analogy, you are avoiding any deliveries to your home and instead go to the post office/UPS/Fedex store to pick up your parcel. Every time. Pros: On-premise assets not exposed to the Internet, firewall issues avoided by only initiating outbound connections Cons: Polling mechanisms may affect performance, may not satisfy near real-time requirements Pattern: Open Firewall Ports The on-premise system exposes the web services that needs to be invoked by the cloud application. This requires opening up firewall ports, routing calls to the appropriate internal services behind the firewall. Fusion Applications uses this pattern, and auto-provisions the services on the various virtual hosts to secure the topology. This works well for service integration, but may not suffice for large volume data integration. Using the home analogy, you have now decided to receive parcels instead of going to the post office every time. A door mail slot cut out allows the postman can drop small parcels, but there is still concern about cutting new holes for larger packages. Pros: optimal pattern for near real-time needs, simpler administration once the service is provisioned Cons: Needs firewall ports to be opened up for new services, may not suffice for batch integration requiring direct database access Pattern: Virtual Private Networking The on-premise network is "extended" to the cloud (or an intermediary on-demand / managed service offering) using Virtual Private Networking (VPN) so that messages are delivered to the on-premise system in a trusted channel. Using the home analogy, you entrust a set of keys with a neighbor or property manager who receives the packages, and then drops it inside your home. Pros: Individual firewall ports don't need to be opened, more suited for high scalability needs, can support large volume data integration, easier management of one connection vs a multitude of open ports Cons: VPN setup, specific hardware support, requires cloud provider to support virtual private computing Pattern: Reverse Proxy / API Gateway The on-premise system uses a reverse proxy "API gateway" software on the DMZ to receive messages. The reverse proxy can be implemented using various mechanisms e.g. Oracle API Gateway provides firewall and proxy services along with comprehensive security, auditing, throttling benefits. If a firewall already exists, then Oracle Service Bus or Oracle HTTP Server virtual hosts can provide reverse proxy implementations on the DMZ. Custom built implementations are also possible if specific functionality (such as message store-n-forward) is needed. In the home analogy, this pattern sits in between cutting mail slots and handing over keys. Instead, you install (and maintain) a mailbox in your home premises outside your door. The post office delivers the parcels in your mailbox, from where you can securely retrieve it. Pros: Very secure, very flexible Cons: Introduces a new software component, needs DMZ deployment and management Pattern: On-Premise Agent (Tunneling) A light weight "agent" software sits behind the firewall and initiates the communication with the cloud, thereby avoiding firewall issues. It then maintains a bi-directional connection either with pull or push based approaches using (or abusing, depending on your viewpoint) the HTTP protocol. Programming protocols such as Comet, WebSockets, HTTP CONNECT, HTTP SSH Tunneling etc. are possible implementation options. In the home analogy, a resident receives the parcel from the postal worker by opening the door, however you still take precautions with chain locks and package inspections. Pros: Light weight software, IT doesn't need to setup anything Cons: May bypass critical firewall checks e.g. virus scans, separate software download, proliferation of non-IT managed software Conclusion The patterns above are some of the most commonly encountered ones for cloud to on-premise integration. Selecting the right pattern for your project involves looking at your scalability needs, security restrictions, sync vs asynchronous implementation, near real-time vs batch expectations, cloud provider capabilities, budget, and more. In some cases, the basic "Pull from Cloud" may be acceptable, whereas in others, an extensive VPN topology may be well justified. For more details on the Oracle cloud integration strategy, download this white paper.

    Read the article

  • Write Parcelable for ArrayList<String []> in android?

    - by sugan.s
    I just created model with String array and array list of string array.Like this public class LookUpModel implements Parcelable { private String [] lookup_header; private ArrayList<String []> loookup_values; public void writeToParcel(Parcel dest, int flags) { dest.writeStringArray(getLookup_header()); }; } I have implemented parcelbale then write for String [] but how to do for the ArrayList<String []> and that values need to pass to another activity.Thanks in advance.

    Read the article

  • The Earth at Night [Video]

    - by Jason Fitzpatrick
    This fresh video from NASA provides the clearest view of the Earth at night ever seen, thanks to the Suomi National Polar-orbiting Partnership Satellite. Check out the video and accompanying pics to see the stunning views. In daylight our big blue marble is all land, oceans and clouds. But the night – is electric. This view of Earth at night is a cloud-free view from space as acquired by the Suomi National Polar-orbiting Partnership Satellite (Suomi NPP). A joint program by NASA and NOAA, Suomi NPP captured this nighttime image by the satellite’s Visible Infrared Imaging Radiometer Suite (VIIRS). The day-night band on VIIRS detects light in a range of wavelengths from green to near infrared and uses filtering techniques to observe signals such as city lights, gas flares, and wildfires. This new image is a composite of data acquired over nine days in April and thirteen days in October 2012. It took 312 satellite orbits and 2.5 terabytes of data to get a clear shot of every parcel of land surface. This video uses the Earth at night view created by NASA’s Earth Observatory with data processed by NOAA’s National Geophysical Data Center and combined with a version of the Earth Observatory’s Blue Marble: Next Generation. Hit up the link below for the full NASA press release, including more videos and photos. How to Factory Reset Your Android Phone or Tablet When It Won’t Boot Our Geek Trivia App for Windows 8 is Now Available Everywhere How To Boot Your Android Phone or Tablet Into Safe Mode

    Read the article

  • Error when starting an activity

    - by Adam
    I'm starting an activity when a button is pressed, and normally (in other apps) haven't had an issue. But when I press the button in this app, I get an "unable to marshal value" error. Exact(ish) error from LogCat: 03-22 02:49:02.883: WARN/System.err(252): java.lang.RuntimeException: Parcel: unable to marshal value {CLASSNAME}@44dcf1b8 I feel that this might be related to the extra that I'm passing to the intent. I'm passing an ArrayList as a serializable to this new intent. My concern is that the data structure that the ArrayList contains isn't being serialized (as it's a personal data structure). Is the array list content data structure causing this? Something else that I'm missing?

    Read the article

  • context.getContextResolved appliaction stopped - begginner in java

    - by Szymad
    I have a problem with my app. I'm trying to execute query, but app stops every time. This error occurs while trying to execute query. I'm learing from Android Pro 3 book, but code presented in this book is deprecated. package com.example.contactsabuout; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts; import android.provider.ContactsContract; import android.app.Activity; import android.database.Cursor; import android.util.Log; import android.content.Context; import android.view.Menu; import android.view.View; import android.widget.TextView; public class MainActivity extends Activity { private static Context context; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MainActivity.context = getApplicationContext(); Log.v("INFO", "Completed: onCreate."); } public static Context getAppContext() { return MainActivity.context; } public void doQuery(View view) { Uri peopleBaseUri = ContactsContract.Contacts.CONTENT_URI; Log.v("II","Button clicked."); Log.v("II", "Uri for ContactsContract.Contacts: " + peopleBaseUri); Context context = getAppContext(); Log.v("II", "Got context: " + context); Cursor cur; Log.v("II", "Created cursor: cur"); cur = context.getContentResolver().query(peopleBaseUri, null, null, null, null); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } FROM LogCat 10-28 17:45:02.513: V/INFO(4677): Completed: onCreate. 10-28 17:45:02.613: D/libEGL(4677): loaded /system/lib/egl/libGLES_android.so 10-28 17:45:02.653: D/libEGL(4677): loaded /system/lib/egl/libEGL_adreno200.so 10-28 17:45:02.723: D/libEGL(4677): loaded /system/lib/egl/libGLESv1_CM_adreno200.so 10-28 17:45:02.723: D/libEGL(4677): loaded /system/lib/egl/libGLESv2_adreno200.so 10-28 17:45:03.014: I/Adreno200-EGLSUB(4677): <ConfigWindowMatch:2078>: Format RGBA_8888. 10-28 17:45:03.054: D/OpenGLRenderer(4677): Enabling debug mode 0 10-28 17:45:03.254: D/OpenGLRenderer(4677): has fontRender patch 10-28 17:45:03.274: D/OpenGLRenderer(4677): has fontRender patch 10-28 17:45:12.873: V/II(4677): Button clicked. 10-28 17:45:12.873: V/II(4677): Uri for ContactsContract.Contacts: content://com.android.contacts/contacts, rest will be null 10-28 17:45:12.873: V/II(4677): Got context: android.app.Application@40d83d90 10-28 17:45:12.873: V/II(4677): Created cursor: cur 10-28 17:45:12.933: D/AndroidRuntime(4677): Shutting down VM 10-28 17:45:12.933: W/dalvikvm(4677): threadid=1: thread exiting with uncaught exception (group=0x40aaf228) 10-28 17:45:12.953: E/AndroidRuntime(4677): FATAL EXCEPTION: main 10-28 17:45:12.953: E/AndroidRuntime(4677): java.lang.IllegalStateException: Could not execute method of the activity 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.view.View$1.onClick(View.java:3071) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.view.View.performClick(View.java:3538) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.view.View$PerformClick.run(View.java:14330) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.os.Handler.handleCallback(Handler.java:608) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.os.Handler.dispatchMessage(Handler.java:92) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.os.Looper.loop(Looper.java:156) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.app.ActivityThread.main(ActivityThread.java:4977) 10-28 17:45:12.953: E/AndroidRuntime(4677): at java.lang.reflect.Method.invokeNative(Native Method) 10-28 17:45:12.953: E/AndroidRuntime(4677): at java.lang.reflect.Method.invoke(Method.java:511) 10-28 17:45:12.953: E/AndroidRuntime(4677): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 10-28 17:45:12.953: E/AndroidRuntime(4677): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 10-28 17:45:12.953: E/AndroidRuntime(4677): at dalvik.system.NativeStart.main(Native Method) 10-28 17:45:12.953: E/AndroidRuntime(4677): Caused by: java.lang.reflect.InvocationTargetException 10-28 17:45:12.953: E/AndroidRuntime(4677): at java.lang.reflect.Method.invokeNative(Native Method) 10-28 17:45:12.953: E/AndroidRuntime(4677): at java.lang.reflect.Method.invoke(Method.java:511) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.view.View$1.onClick(View.java:3066) 10-28 17:45:12.953: E/AndroidRuntime(4677): ... 11 more 10-28 17:45:12.953: E/AndroidRuntime(4677): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.contacts.HtcContactsProvider2 uri content://com.android.contacts/contacts from pid=4677, uid=10155 requires android.permission.READ_CONTACTS 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.os.Parcel.readException(Parcel.java:1332) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:182) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.content.ContentProviderProxy.query(ContentProviderNative.java:406) 10-28 17:45:12.953: E/AndroidRuntime(4677): at android.content.ContentResolver.query(ContentResolver.java:315) 10-28 17:45:12.953: E/AndroidRuntime(4677): at com.example.contactsabuout.MainActivity.doQuery(MainActivity.java:47) 10-28 17:45:12.953: E/AndroidRuntime(4677): ... 14 more I'm trying to learn android.

    Read the article

  • Win32 Window Menu is appearing along left side instead of across top of window

    - by Khat
    I think I may be using a wrong window style or something or maybe just adding the menu to the window incorrectly. I'll post a link to an image here so you can see what I mean about the menu not diplaying correctly: http://img707.imageshack.us/img707/4828/wtfmenu.jpg And here's a link to the code that creates the menu and the window: http://pastebin.com/CBrSVXUD I'm sure I'm missing something simple and dumb in the labyrinth of styles, settings and etc that are part and parcel for the Win32 API. Has anyone seen this before and know what I'm doing wrong? I just want a 'normal' menu bar along the top, snug against the title bar. Thanks in advance for any advice.

    Read the article

  • When Less is More

    - by aditya.agarkar
    How do you reconcile the fact that while the overall warehouse volume is down you still need more workers in the warehouse to ship all the orders? A WMS customer recently pointed out this seemingly perplexing fact in a customer conference. So what is going on? Didn't we tell you before that for a warehouse the customer is really the "king"? In this case customers are merely responding to a low overall low demand and uncertainty. They do not want to hold down inventory and one of the ways to do that is by decreasing the order size and ordering more frequently. Overall impact to the warehouse? Two words: "More work!!" This is not all. Smaller order sizes also mean challenges from a transportation perspective including a rise in costlier parcel or LTL shipments instead of cheaper TL shipments. Here is a hypothetical scenario where a customer reduces the order size by 10% and increases the order frequency by 10%. As you can see in the following table, the overall volume declines by 1% but the warehouse has to ship roughly 10% more lines. Order Frequency (Line Count)Order Size (Units)Total VolumeChange (%)10010010,000 -110909,900-1% If you want to see how "Less is More" in graphical terms, this is how it appears: Even though the volume is down, there is going to be more work in the warehouse in terms of number of lines shipped. The operators need to pick more discrete orders, pack them into more shipping containers and ship more deliveries. What do you do differently if you are facing this situation?In this case here are some obvious steps to take:Uno: Change your pick methods. If you are used to doing order picks, it needs to go out the door. You need to evaluate batch picking and grouping techniques. Go for cluster picking, go for zone picking, pick and pass...anything that improves your picker productivity. More than anything, cluster picking works like a charm and above all, its simple and very effective. Dos: Are you minimize "touch" points in your pick process? Consider doing one step pick, pack and confirm i.e. pick and pack stuff directly into shipping cartons. Done correctly the container will not require any more "touch" points all the way to the trailer loading. Use cartonization!Tres: Are the being picked from an optimized pick face? Are the items slotted correctly? This needs to be looked into. Consider automated "pull" or "push" replenishment into your pick face and also make sure that high demand items are occupying the golden zones.  Cuatro: Are you tracking labor productivity? If not there needs to be a concerted push for having labor standards in place. Hope you found these ideas useful.

    Read the article

1 2  | Next Page >