I recently got a Samsung Omnia phone and I love this thing. Then I decided to play around with .NET programming for windows mobile and decided to write a small alarm app using the accelerometer. The problem was, there was hardly any code about using the accelerometer. That is until I stumbled upon the SDK for Samsung Mobile Phones. The one catch was, it is written in C++, with DLL wrappers written in C#, no VB. So I took the C# wrapper code and converted it over to VB.NET and included it in my application.
shared.vb
acceleromoter.vb
In order to use these files, you will need to download the Samsung Mobile SDK from http://innovator.samsungmobile.com/
Here is an example on how to use the code:
Dim AccVec As New SamsungMobileSdk.Accelerometer.Vector()
Dim Accelerometer As New SamsungMobileSdk.Accelerometer
If Accelerometer.GetVector(AccVec) = SamsungMobileSdk.SmiResultCode.Success Then
Dim x,y,z as integer
x = AccVec.x
y = AccVec.y
z = AccVec.z
end if
Tags: .NET, Mobile, Omnia, Samsung, SDK, VB.NET
This is my first attempt at a custom function library. I find myself using some of the same functions through out my apps that I just decided to put it in just one small package.
Here is the networking side of it:
IsIP(IPAddress as String)
IPAddress: A String with an IP address in it.
Returns: True or False
IsSubnet(SubnetMask as String)
SubnetMask: Takes a string with a valid SubnetMask or CIDR Notation.
Returns: True or False
CIDRtoSubnet(CIDRNotation as String)
CIDRNotation: A string with a valid CIDR notation.
Returns: Returns a SubnetMask, or false if invalid.
GetIPRanges(NetworkAddress as String)
NetworkAddress: Takes a string with a valid IP address and SubnetMask.
Returns: An array with the beginning and ending IP address range. Returns false if its invalid.
IsInIPRange(IPAddress as String, SubnetMask as String, IPtoCheck as String)
IPAddress: String with a valid IP address.
SubnetMask: String with a valid IP address.
IPtoCheck: String of the IP address to check.
Returns: True or False
IPIncrement(IPAddress as String, Increment as Double, Optional SubnetMask as String)
IPAddress: A String with a valid IP address.
Increment: A positive numeric value to increase the IP address.
SubnetMask (optional): To check if the incremented IP address is in a valid network range.
Returns: Returns a valid IP address. (Returns False if SubnetMask is used and the IP address is out of range.)
Tags: Functions, Jinan, Library, Networking, VB.NET