[android-developers] RESTful webservice with auth for mobile application
I have developed many stateless RESTful webservices for a mobile application in Java and they are working very well. *For example:* - h t t p://.../api/coupon - h t t p://.../api/coupon/{id} - ... Now, I have to extend these services because I have to send different data back to the mobile for every user. So I need to know on the server side which user try to get or set information. And I have to prevent the serve of unauthorized users. *There are two different way how user can login into the mobile application: * 1. log in with facebook account 2. log in with an application account I need to develop two login and a logout services because the users who use the mobile application have to login into the application. I read lots of article about auth and RESTful and OAuth. I think I have to develop two login services with two imput parameters: username and password. *For example:* - localLogin(String username, String password) -> token - facebookLogin(String username, String password) -> token These logon services have to generate a same token and send it back to the mobile application in the http header. And after the login process the mobile client has a token. And the client has to send this token to the server when it makes a RESTful server call. What do you think? Is my idea good? If it is, could you help me how can I start to develop this in Java? If it is not, could you tell me the good way? Thank you. -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] RESTful webservice with auth for mobile application
This tutorial is good for client side (mobile). But I am developing services on server side (backend). How can I link together this client side logon function with my restful web service (with auth) on server side? On Friday, March 15, 2013 1:15:17 AM UTC+11, Kristopher Micinski wrote: > > This is what is typically done. Except one thing: I wouldn't ask for > the user's Facebook credentials in your app. (At the very least > that's unprofessional.) Instead, I'd try to request it from the > Facebook app (if they have it installed). > > > https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/ > > > Kris > > On Thu, Mar 14, 2013 at 10:03 AM, SoMa > > wrote: > > I have developed many stateless RESTful webservices for a mobile > application > > in Java and they are working very well. > > > > For example: > > > > h t t p://.../api/coupon > > h t t p://.../api/coupon/{id} > > ... > > > > > > Now, I have to extend these services because I have to send different > data > > back to the mobile for every user. So I need to know on the server side > > which user try to get or set information. And I have to prevent the > serve of > > unauthorized users. > > > > There are two different way how user can login into the mobile > application: > > > > log in with facebook account > > log in with an application account > > > > > > I need to develop two login and a logout services because the users who > use > > the mobile application have to login into the application. > > > > I read lots of article about auth and RESTful and OAuth. > > I think I have to develop two login services with two imput parameters: > > username and password. > > > > For example: > > > > localLogin(String username, String password) -> token > > facebookLogin(String username, String password) -> token > > > > > > These logon services have to generate a same token and send it back to > the > > mobile application in the http header. And after the login process the > > mobile client has a token. And the client has to send this token to the > > server when it makes a RESTful server call. > > > > > > What do you think? Is my idea good? > > > > If it is, could you help me how can I start to develop this in Java? > > > > If it is not, could you tell me the good way? > > > > Thank you. > > > > -- > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to > > android-d...@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > --- > > You received this message because you are subscribed to the Google > Groups > > "Android Developers" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to android-developers+unsubscr...@googlegroups.com . > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Dalvik VM Verify Error
Hi All, I'm currently working on a Wrapper for Android, Which wraps an android apk with some DRM related stuff.. which are by the way Android activities.. The activities i had created worked perfectly when I tested them in an Emulator as well as on a Device. I tried integrating it with an Application from our org's apps store... Steps below * Extracted the apk with apktool * Extracted class files with dex2jar * added the class files to an Eclipse android project as classes folder * Added the activity def from the original app manifest to my manifest * Compiled and Launched the app from eclipse Note : The activities I had created are working very fine.. They load complete their work and try to launch the game application i was using to Test Integration. here's when I come across the VerifyError 11-20 22:44:07.670: W/System.err(281): at java.lang.Thread.run(Thread.java:1096) 11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v0 type 12, wanted 10 11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v1 type 12, wanted 10 11-20 22:44:08.050: W/dalvikvm(281): VFY: rejecting opcode 0x71 at 0x0016 11-20 22:44:08.050: W/dalvikvm(281): VFY: rejected Lao;.a (Ldh;)I 11-20 22:44:08.050: W/dalvikvm(281): Verifier rejected class Lao; 11-20 22:44:08.060: D/AndroidRuntime(281): Shutting down VM 11-20 22:44:08.060: W/dalvikvm(281): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 11-20 22:44:08.170: E/AndroidRuntime(281): FATAL EXCEPTION: main 11-20 22:44:08.170: E/AndroidRuntime(281): java.lang.VerifyError: ao 11-20 22:44:08.170: E/AndroidRuntime(281): at ca.jamdat.flight.trivialpursuit_hvga_eu.FlAndroidApp.onCreate(Unknown Source) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2627) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2679) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.os.Handler.dispatchMessage(Handler.java:99) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.os.Looper.loop(Looper.java:123) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.main(ActivityThread.java:4627) 11-20 22:44:08.170: E/AndroidRuntime(281): at java.lang.reflect.Method.invokeNative(Native Method) 11-20 22:44:08.170: E/AndroidRuntime(281): at java.lang.reflect.Method.invoke(Method.java:521) 11-20 22:44:08.170: E/AndroidRuntime(281): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:868) 11-20 22:44:08.170: E/AndroidRuntime(281): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-20 22:44:08.170: E/AndroidRuntime(281): at dalvik.system.NativeStart.main(Native Method) Please Help -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Please Help, DalvikVM, Check Verify Failed at VFY: register1 v0 type 12, wanted, Rejected Opcode
Hi All, If you find this recurring post, sorry my first post was not yet approved at time of Posting this and it is quite urgent for me to wait... I'm currently working on a Wrapper for Android, Which wraps an android apk with some DRM related stuff.. which are by the way Android activities.. The activities i had created worked perfectly when I tested them in an Emulator as well as on a Device. I tried integrating it with an Application from our org's apps store... Steps below * Extracted the apk with apktool * Extracted class files with dex2jar * added the class files to an Eclipse android project as classes folder * Added the activity def from the original app manifest to my manifest * Compiled and Launched the app from eclipse Note : The activities I had created are working very fine.. They load complete their work and try to launch the game application i was using to Test Integration. here's when I come across the VerifyError 11-20 22:44:07.670: W/System.err(281): at java.lang.Thread.run(Thread.java:1096) 11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v0 type 12, wanted 10 11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v1 type 12, wanted 10 11-20 22:44:08.050: W/dalvikvm(281): VFY: rejecting opcode 0x71 at 0x0016 11-20 22:44:08.050: W/dalvikvm(281): VFY: rejected Lao;.a (Ldh;)I 11-20 22:44:08.050: W/dalvikvm(281): Verifier rejected class Lao; 11-20 22:44:08.060: D/AndroidRuntime(281): Shutting down VM 11-20 22:44:08.060: W/dalvikvm(281): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 11-20 22:44:08.170: E/AndroidRuntime(281): FATAL EXCEPTION: main 11-20 22:44:08.170: E/AndroidRuntime(281): java.lang.VerifyError: ao 11-20 22:44:08.170: E/AndroidRuntime(281): at ca.jamdat.flight.trivialpursuit_hvga_eu.FlAndroidApp.onCreate(Unknown Source) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2627) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2679) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.os.Handler.dispatchMessage(Handler.java:99) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.os.Looper.loop(Looper.java:123) 11-20 22:44:08.170: E/AndroidRuntime(281): at android.app.ActivityThread.main(ActivityThread.java:4627) 11-20 22:44:08.170: E/AndroidRuntime(281): at java.lang.reflect.Method.invokeNative(Native Method) 11-20 22:44:08.170: E/AndroidRuntime(281): at java.lang.reflect.Method.invoke(Method.java:521) 11-20 22:44:08.170: E/AndroidRuntime(281): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:868) 11-20 22:44:08.170: E/AndroidRuntime(281): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-20 22:44:08.170: E/AndroidRuntime(281): at dalvik.system.NativeStart.main(Native Method) Please Help -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Please help me out with problem of indefinite service
Hi, Please let me know.. how do we make the service still run even though the Activity that launched it is killed.. I tried STICK_SERVICE, but of no use.. I still find the service being killed... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] android + eclipse -> strange behavior
Hi! I use eclipse helios with android plugins. I use this developing tool for long time ago. Now I realized a strange behavior. Is it a bug? http://kepfeltoltes.hu/view/110817/eclipse_01_www.kepfeltoltes.hu_.png http://kepfeltoltes.hu/view/110817/eclipse_02_www.kepfeltoltes.hu_.png Value of ageOfLocation is -1 and the eclipse step into wrong if else row. Why? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en