这是设计购物车 Android 应用程序的正确方法吗?
我需要开发一个购物车 Android 应用程序。
这些功能应包括
- 任何客户都可以注册的能力
- 使用其凭据登录的能力
- 搜索并选择产品
- 查看有关其先前购买的历史记录
- 进行付款以将产品运送到他的帐单地址。
我做了一些分析,以下是我的想法。
服务器端:Java Web 应用程序 客户端:Android 应用程序
使用 Activity 设计 Android 应用程序,以允许客户自行注册。
设计另一个活动,使客户能够登录到应用程序(通过 HttpClient 将其凭据发送到 Java servlet 来验证客户身份。成功验证客户身份后,在服务器端生成一个唯一的令牌 ID,将其存储在数据库中,并将其发送到 Android 客户端应用程序。这是记住客户(类似于会话管理)以便与应用程序进一步交互的正确方法吗?)
为客户提供搜索和选择所需产品的能力(使用上面创建的唯一令牌与服务器进一步交互)。
使客户能够查看其购买历史记录。
为客户提供付款能力。 (我可以从 Android 应用程序中获取客户 PayPal 凭证并使用 PayPal API 在服务器端进行务实付款吗?这是正确的方法吗?
有人可以建议我使用正确的方法/最佳实践并提供示例代码吗?
谢谢,
I have a requirement to develop a shopping cart Android application.
The features should include
- Ability for any customer to register
- Ability to login with his credentials
- Search and select products
- View history about his previous purchases
- Make payment to get the products delivered to his billing address.
I have done some analysis and below are my thoughts.
Server Side: Java web application
Client Side: Android application
Design Android application with an Activity to allow customers to register themselves.
Design another Activity to enable customers to login to the application (authenticate customer by sending his credentials through HttpClient to a Java servlet. Once the customer is authenticated successfully, generate a unique token id at the server end store it in the database and send it to the Android client app. Is this the correct approach to remember the customer (similar to session management) for his further interactions with the application?)
Provide customers the ability to search and select desired products (use above created unique token for further interaction with server).
Provide customers the ability to view his history of purchases.
Provide customers the ability to make payments. (Can i take customer PayPal credentials from Android app and use PayPal API to pragmatically make payments at server end? Is it correct approach?
Can someone please suggest me with correct approach / best practices and with sample code if possible?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我很了解您,您只需要一个适合您网站需求的应用程序。
您建议使用 Android 原生代码并通过 HTTP Worker 与您的网站交互。
这提供了更高的集成度,但并不是真正必要的。
另一种方法是编写
WebApplication
代码。主要来说,这就像围绕WebView
< 构建应用程序/a>.将其视为具有 cookie、javascript 和会话管理的集成 Web 浏览器。通过这种方法,您可以在网站上保留尽可能多的内容(使用隐藏的类似移动版本),并在任何您想要的地方添加标准 Android 小部件。一个好处是,您可以直接在网站上纠正部分错误,而无需要求人们下载更新。
If I understand you well, you only need an application that is taylored to your website needs.
You suggest to use android native code and interract with your website through HTTP worker.
This provides the higher integration but is not really necessary.
Another approach is to code a
WebApplication
. Mainly, this is like building your application around aWebView
. Think of it as an integrated web browser with cookies, javascript and session management. With this approach you can keep as much as possible on your website (using an hidden mobile-like version) and yet add standard android widgets wherever you want.One nice point is that you can correct part of the bugs directly on the website, without asking people to download an update.