log in using cellphones in asp.net Applications - c#

I have an ASP.NET application done in C#. When a user logs in using a phone it redirects the user to the mobile version of the application. Now what i need, is to find out what type of phone they use when they log in, Android , Iphone , etc...
I'd appreciate any solution.

In javascript you can glean quite a lot of information from navigator.userAgent
example:
function isAndroid()
{
navigator.userAgent.match(/Android/i);
}
This will return true if the device is Android.
More information here:
http://www.abeautifulsite.net/blog/2011/11/detecting-mobile-devices-with-javascript/

(disclaimer - not a web dev)
You are going to have to make a best guess by what type of browser they are using.
See http://msdn.microsoft.com/en-us/library/3yekbd5b(v=vs.100).aspx
You may be able to determine the OS and device based on this, depending on how the browser is versioned. It will require a xref table to map the browser to a device.
Also, check out this, I think it may help you:
http://www.codeproject.com/Articles/34422/Detecting-a-mobile-browser-in-ASP-NET
HTH,
Eric

Related

Send and Receive Messages between Android App and Winform application

Looked for a long time and didn't find anything that showed this, so I apologize in advance I missed something.
I have an android app running on KitKat (Android 4.4.2) and a Winforms application running Windows 7. I need to send messages between the two of them.
Clearly GCM works to get the message to the Android device. I have code that sends from Winforms to the Android Device using GCM. I cannot find a way to have the Android App send anything BACK though. Is it possible to have a Winforms app RECEIVE a GCM Message? Do I have to use Azure? (All examples there seem to focus on the Windows App store and Windows 8.1 neither one of which can be a solution in this case due to client restraints.)
I'm putting this here in case anyone stumbles across it and has a similar question. This is not really an answer. Still hoping someone comes on here and shows that I am wrong. But after 26 days, no one has even offered a suggestion, so I'm guessing not.
There is no way that I have seen that allows for this the way I had hoped. Windows 7 doesn't have this built in to it (AFAIK). Windows 10 should have it built in, but Windows 7 pre-dates the huge shift to the cloud, and didn't have it in the design. If I were working with something like Xamarin -- which is a cross-platform tool, this might be possible. But there is no concept in Windows 7 for receiving messages from the Cloud.
In order to accomplish this, there would have to be some sort of server added to the mix that could take messages and pass them along via a REST API. This is beyond the scope of what I wanted to code.
The solution I found, and that works for me, is to use Microsofts API that wraps a REST service. This allows for communication to OneDrive, for example. That is what I am using as my intermediary REST server.
Microsoft LIVE SDK
This has a pretty good sample list of Android examples, and can be used for what I need. The good thing is the Upstream is just a simple call, and I don't need to have the Android device poll anything (which kills the battery). The laptop will need to poll OneDrive, but its plugged in so there is no battery life concern.
One thing to be aware of, though, is that Microsoft sort of hints that they don't want a bunch of traffic headed to OneDrive. This is from the overview doc:
Throttling
OneDrive has limits in place to make sure that individuals and apps do
not adversely affect the experience of other users. When an activity
exceeds OneDrive's limits, API requests will be rejected for a period
of time. OneDrive may also return a Retry-After header with the number
of seconds your app should wait before sending more requests.
Although, I have never seen what those limits actually are, so YMMV.

How to create two apps which connect to the same database?

Basically what i am trying to do is to create a desktop app and a phone app(for my IT course) which get and insert data into the same database.
First i thought i could use normal db with remote access but i found out that it isn't the best practice (also not all hosting company allows you remote access and when they allow it you have to insert the IP of the machines which will make the requests, and i do not want something like that). So what do i have to do ? I've been searching a lot but i couldn't find nothing. What i'm looking for is some sort of guide to do this because i really have no idea how to do it. Sorry for my bad english and thanks you all.
Sounds like what you need to do is create a web service that both, your mobile and your desktop apps would connect to to save and retrieve data.
Use existing services. I HIGHLY recommend https://parse.com/ . You can accomplish what you need using their service. Their quickstart guides are VERY simple to understand. It supports iOS, Android, .NET(C#) and many more platforms. Also, for what you need, it is free.

Traffic Data on Windows Phone 8 App, How? What about Terms Of Use?

Can one use Microsof/Nokia's traffic data on Windows Phone 8? How?
It seems to be very easy for a Windows Store app..
So.. I explored Microsoft.Phone.Maps.Controls.Map, no luck.
I can't find any code or post on how to get traffic data in C# for Windows Phone 8. I fear that there is be something I should know.
There is a RESTful Traffic API but I'm somewhat confused about Terms Of Use.
I suppose I would fit in the free-app-with-ads model. In this context, are the transactions billable?
For Bing Maps:
You could easily use the Traffic REST service to provide information about traffic on your control but in fact, there might be issues regarding the Terms of Use as it might be not authorized to use it in another scenario than in a Webpage (whatever the protocol). See 8.2.i (see also point 9 about Mobile APP):
http://www.microsoft.com/maps/product/terms.html
In this case, you'd be in competition against the GPS devices (Garmin and so on) and that's probably the main reason you might have problems to do so. You can reach maplic#microsoft.com if you have a specific use case in mind and want to make sure you would be able to create the application in the way you want.
Anyway, if it's for a Proof Of Concept kind of application, you can use the REST service to get information along a route or for a specific area, see the MSDN here:
http://msdn.microsoft.com/en-us/library/hh441728.aspx
And here is an example to use it in a .Net application (so in your WP client application):
http://msdn.microsoft.com/en-us/library/jj819168.aspx
For Nokia Maps:
Nokia's offer integrates a dedicated traffic API that is not part of the public API but rather from their Nokia Location Platform (also called Here Platform for Enterprise) and with this API you can retrieve information for a specific area and get precise information like in Bing's REST service.
You should reach your Nokia's representatives to get more information if needed about this service.
Let us know if you have any further question.

How to start up your .NET program from web browser?

Could you provide example of JavaScript function for starting up application installed on your computer from a web browser (eg google chrome 4). It particular if .Net APPs have any special simplifying this process apis of out there are some libs for such staff, please share link with us.
so how to create and store in run on start up programs a small local server which would handel some local urls like http://localhost/maAppServer/MyAppCalculator/Start for starting apps that have written in its config file their names and local urls on install?
So how to start up your C# .NET app\program from web browser?
I don't believe its possible in Chrome, starting an EXE on a users computer could be considered a security violation. Some ActiveX, and file:// links in internet explorer may work. Also, OneClick deployment may do something similar to what you are after (not exactly though I don't think, and I believe they require an add-in which may not be available for Crhome) http://www.15seconds.com/issue/041229.htm
I'm not sure what you're asking for. You can start an application on your computer just by linking to it in the HTML page. However, if you need to pass data to it, then it's a different matter altogether, although it's still simple.
An example is what www.nexon.com does with it's MMORPG, MapleStory. You log on to the website, and the web page starts the game after the authentication. Another example would be the magnet links on file-sharing sites.
You need to create a protocol handler, it can be in any language like C++/C# and register it on the client's computer. Like so - http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx
Then, just use the protocol you built to pass on whatever data necessary. You can add a link that can be clicked, a button, Response.Redirect() from the server, whatever you like.

.NET XBox Live Account API

Is there a .NET API available to get data from your XBox Live account?
All I'm really interested in is who's online, but messages would be cool too. And some sort of event driven notifications of user sign-on would be great, but I'll poll if need be.
Check out the Xbox Community Developer Program.
You can also try and take a look at https://xboxapi.com/
They provide a API system to get all sorts of info.
Example dev: https://xboxapi.com/dev/profile/Major+Nelson
their documentation is here, https://xboxapi.com/documentation
it provides info to get data in PHP json, xml, or dev.
Sadly I dont think anything like Messages and some notifications, only publicly visible info. But if you track profile info one can generate a history and if you poll the online status, you can make a popup or something

Categories

Resources