Sending ASP.NET variable/account information to Android device - android

I'm using an Android device to display an ASP.NET MVC web application and I was wondering if it's possible to send account information to the android device?
My main goal is to use the users account log-in details to set up a specific save path on the android. If I was able to send the users log-in username to the android device this would be possible.

I'm posting one of the links which deals with this topic extensively (a well written article) http://www.codeproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap. [NOTE: This solution utilizes the KSOAP library jar for android platform. ]
Basically you would want to have one of the web service methods return the logged-in user, this method can be invoked by Android's native java class.

Related

How can I connect the between web application with an application?

1) I have a web application. This web app is for a user to buy a point.
2) I have an android application for parking payment. Payment is based on point that user buy from the admin. Since I made two things which are web app for admin and android app for user, so I will have two database for each one right?
3) So, how can I transfer the point that user buy from the admin to an android application? Is this thing has to do with JSON fetch or pass data?
4) Basically I want the user to get the point from the web application? Your answer will be really helpful to me, thank you :)
The issue is design issue. Your mobile app and the web app don’t have to be two separate.
You can have one application with one database that both web and mobile point to.
If you’re using Android look into ionic framework that can help you code one codebase targeting both web and mobile.
See
https://ionicframework.com
https://scotch.io/tutorials/create-your-first-mobile-app-with-angularjs-and-ionic
You will have to build a single server for both your admin and your app. Both will have a single database that is controlled by your server. Your app will request the same server to redeem points and your admin will request the server to add points. You can use retrofit library in android for making api calls to your server
The web application and the android application must connect to the same database on the server. In the android application, to you get the data via json, you must use asynctask to download the server information or use libraries like Retrofit or volley that facilitate the handling of json.

Developing both Rails Web App and Android App that shares only one Database

I'm a 3rd year BSIT student who wants to pursue a career of Web Development in the near future. We decided for our thesis to make a Web App about a certain topic using Ruby on Rails since it's the tool that we used during our WebDev class. I've had several experiences and accomplished projects using RoR thanks to the help of this site.
Our Adviser suddenly suggested us to make an Android version of the app for the customer's side to utilize it's portability. what we would like to happen is the Customers can input and retrieve data through that android app from a database, on the other hand, the admin can also do the same using a Desktop Web App utilizing also the the same database used by the customers.
Is there any other recommendations of lightweight development and database tools that can help us make the desired Web App beside Android Studio and Eclipse? Much better if it can support Rails or Ruby.
Note: Also, we're planning to include a GPS feature where you can locate certain shops using the said android app
What you are looking for is an API. You have a Rails app, now you have to expose API endpoints from your Rails App which your Android App can access and send requests to.
I don't know if you learned about APIs yet but in short, you set up new links that retrieve information from the parameters and respond using either JSON or XML. Your android app will for example have a login form:
Name = john
Password = anything
When they submit the form, you take the name and password and send it using an HTTP request from Android to your Rails App.
#stupid example but this is how the link would somehow look like
http://www.your-site.com/api/login?name=john&password=anything
Your rails app should be setup to receive request via an API controller:
class ApiController < ApplicationController
def login
#authenticate user
#respond with json
end
end
Your Android app receives a JSON response from Rails, usually a status code telling Android that the authentication was successful or failed and then you have access to your Web App using Android but nothing is secure and you will have to setup tokens for each request, etc because API's don't have sessions like a browser. But since you are talking about a school project and not a production app maybe you can ignore the security part.
Read this blog post on how to build an API:
https://labs.kollegorna.se/blog/2015/04/build-an-api-now/

json with android mobile application

Hi guys so I am new to android development or any mobile device development.
So I am working on a project that consists of two application.
One with ASP.NET MVC4, one with Android.
what it is doing right now, Android device is accessing database server of ASP.Net application and saves data. This is able because currently, android app has database access information in the codes(db login info).
Since method above is extremely stupid I need help.
So what I am looking into is to use JSON(if possible). ASP.NET MVC4 application is already JSON ready, and i've made sandbox application that brings information from web app to android app. BUT my question here is is it possible to do same thing the other way around. Is it possible to make android application to make JSON and web application to access that application? I dont think this is possible.
So how do other REAL mobile applications save users data on their database server without including db access information within the code?
This is usually done through web api - have a look at twitters api as an example https://dev.twitter.com/docs/api/1.1
You would have to pass data to the server using the api, just as you would use an api to get data from the server.

How to link a website with an android app

I was wondering how can you link the fields of a website with an app. Like I have a college attendance website where we all check our attendance and then a student made an app on android where we login by entering the student id and password. So how was the person able to send info from the app to the website and get the information?? Thanks in advance! The website is www.websismit.Manipal.edu.
See you there are some ways as follows:-
you can make an android app having single activity with webview and
open your site inside the webview. you can also use html 5 and jquery mobile for that.
you can make an native application and using web-services you can
get/set the parameter result.
In thin client mobile applications, we generally deal with lot of data exchange between server and mobile app. Mobile app is nothing but a client. So in order to get/post data from server you have to write APIs.
Now writing restful API is your choice you can use any on the available language.
I believe your website is up already so just search and you can easily get ways to expose RESTful APIs.
There are different ways to identify client request, for that you should use Access Token to identify the clientID/UserID or whatever id you are maintaining.
For consuming API from android, you can refer to this tutorial.

Android App for Rails App storing Sessions/Cookie

I am new to both Android and Rails. I built a simple Rails app to log in to post comments and leave replies to others' comments as well. I am trying to see how to build a native Android app to respond to this Rails app and have come across a question with sessions/cookie.
In order for me to build a native android app that can allow a user to log in and browse through the rails app, do I have to write a code that receives cookie from the rails app and store it in android sqlite database? Thanks
Are you trying to load a view in HTML (an embedded browser), or render a view on the device using the native controls? If you're doing the former, surely Android already handles all this for you, just like a WebView in an iPhone app does?
If you're doing the latter, you should build an API that uses something like OAuth for authentication, rather than maintaining a session cookie. This approach means that you store a pair of (revokable) OAuth credentials on the device and that you don't need to work with the user's username/password.
I'm not sure on what your end goal is here.

Categories

Resources