How can I detect that a device is from Motorola !

hi all !
I want to detect if my device is a Motorola one, to do so, I was checking the class com.motorola.extensions.ScalableImage, if it's present I know that the device is a Motorola.
but, now, I have some devices (V8) that didn't support this class, so how can I do otherwise ?
I saw that there's an API named get URL from flex, but i don't now more about !
some one can help me ?
Regards, Idir

check this out
// detecting NOKIA or SonyEricsson 
                  try { 
                           final String currentPlatform = System.getProperty("microedition.platform"); 
                           if (currentPlatform.indexOf("Nokia") != -1) { 
                               return "nokia"; 
                           } else if (currentPlatform.indexOf("SonyEricsson") != -1) { 
                               return "SE"; 
                  } catch (Throwable ex) { 
               // detecting SAMSUNG 
                  try { 
                           Class.forName("com.samsung.util.Vibration"); 
                           return "samsung";
                  } catch (Throwable ex) { 
               // detecting MOTOROLA 
                  try { 
                           Class.forName("com.motorola.multimedia.Vibrator"); 
                           return "motorola";
                  } catch (Throwable ex) { 
                           try { 
                               Class.forName("com.motorola.graphics.j3d.Effect3D"); 
                               return "motorola";
                           } catch (Throwable ex2) { 
                               try { 
                                        Class.forName("com.motorola.multimedia.Lighting"); 
                                        return "motorola";
                               } catch (Throwable ex3) { 
                                        try { 
                                            Class.forName("com.motorola.multimedia.FunLight"); 
                                            return "motorola";
                                        } catch (Throwable ex4) { 
               // detecting SIEMENS
                  try { 
                           Class.forName("com.siemens.mp.io.File"); 
                           return "siemens"; 
                  } catch (Throwable ex) { 
               // detecting LG 
                  try { 
                           Class.forName("mmpp.media.MediaPlayer"); 
                           return "LG";
                  } catch (Throwable ex) { 
                           try { 
                               Class.forName("mmpp.phone.Phone"); 
                               return "LG";
                           } catch (Throwable ex1) { 
                               try { 
                                        Class.forName("mmpp.lang.MathFP"); 
                                        return "LG";
                               } catch (Throwable ex2) { 
                                        try { 
                                            Class.forName("mmpp.media.BackLight"); 
                                            return "LG";
                                        } catch (Throwable ex3) { 
                  }  pravin

Similar Messages

  • How can I detect that there is an internet connection?

    How can I detect that there is an internet connection?
    Peter Goossens

    How can I detect that there is an internet connection?
    Peter Goossens
    Peter,
    You might want to experiment with this. It's not perfect, but...
    Class
    Imports System.IO
    Imports System.Net
    Namespace InternetConnection
    Public Class SiteInfo
    Private _displayName As String
    Private _connectionString As String
    Private Sub New(ByVal name As String, _
    ByVal connectionString As String)
    _displayName = name.Trim
    _connectionString = connectionString.Trim
    End Sub
    ''' <summary>
    ''' Gets the connection string of this instance.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property ConnectionString() As String
    Get
    Return _connectionString
    End Get
    End Property
    ''' <summary>
    ''' Gets the display name of this instance.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property DisplayName() As String
    Get
    Return _displayName
    End Get
    End Property
    ''' <summary>
    ''' A method which will add a new site to your collection of SiteInfo.
    ''' </summary>
    ''' <param name="siList">Your generic List(Of SiteInfo).</param>
    ''' <param name="displayName">The display name for this new instance
    ''' of SiteInfo.</param>
    ''' <param name="connectionString">The connection string for this
    ''' new instance of SiteInfo.</param>
    ''' <remarks></remarks>
    Public Shared Sub AddNew(ByRef siList As List(Of SiteInfo), _
    ByVal displayName As String, _
    ByVal connectionString As String)
    Try
    If siList Is Nothing Then
    Throw New NullReferenceException("The collection of SiteInfo cannot be null.")
    ElseIf String.IsNullOrEmpty(displayName) OrElse displayName.Trim = "" Then
    Throw New ArgumentException("The display name cannot be null or empty.")
    ElseIf String.IsNullOrEmpty(connectionString) OrElse connectionString.Trim = "" Then
    Throw New ArgumentException("The connection string cannot be null or empty.")
    Else
    If siList.Count > 0 Then
    Dim findDuplicate As IEnumerable(Of SiteInfo) = _
    From si As SiteInfo In siList _
    Where si.DisplayName.ToLower.Replace(" "c, "") = _
    displayName.ToLower.Replace(" "c, "") AndAlso _
    si.ConnectionString.ToLower.Replace(" "c, "") = _
    connectionString.ToLower.Replace(" "c, "")
    If findDuplicate.Count <> 0 Then
    Throw New ArgumentException("This is a duplicate entry.")
    Else
    siList.Add(New SiteInfo(displayName, connectionString))
    End If
    Else
    siList.Add(New SiteInfo(displayName, connectionString))
    End If
    End If
    Catch ex As Exception
    Throw
    End Try
    End Sub
    ''' <summary>
    ''' A method which will return a boolean value to indicate internet
    ''' connection status.
    ''' </summary>
    ''' <param name="siList">Your generic List(Of SiteInfo).</param>
    ''' <param name="displayName">The display name for the instance
    ''' of SiteInfo to use.</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared Function InternetIsConnected(ByVal siList As List(Of SiteInfo), _
    ByVal displayName As String) As Boolean
    Dim retVal As Boolean = False
    Try
    If siList Is Nothing Then
    Throw New NullReferenceException("The collection of SiteInfo cannot be null.")
    ElseIf siList.Count = 0 Then
    Throw New ArgumentOutOfRangeException("Count", "The collection of SiteInfo cannot be empty.")
    ElseIf String.IsNullOrEmpty(displayName) OrElse displayName.Trim = "" Then
    Throw New ArgumentException("The display name cannot be null or empty.")
    Else
    Dim findInstance As IEnumerable(Of SiteInfo) = _
    From si As SiteInfo In siList _
    Where si.DisplayName.ToLower.Replace(" "c, "") = _
    displayName.ToLower.Replace(" "c, "")
    If findInstance.Count <> 1 Then
    Throw New ArgumentException("This instance is not in the collection of SiteInfo.")
    Else
    retVal = TestConnection(findInstance.First.ConnectionString)
    End If
    End If
    Catch ex As Exception
    Throw
    End Try
    Return retVal
    End Function
    Private Shared Function TestConnection(ByVal url As String) As Boolean
    Dim retVal As Boolean = False
    Try
    Dim request As WebRequest = WebRequest.Create(url)
    Using response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse)
    Using dataStream As Stream = response.GetResponseStream
    Using reader As New StreamReader(dataStream)
    Dim responseFromServer As String = reader.ReadToEnd()
    retVal = True
    End Using
    End Using
    End Using
    Catch ex As WebException
    retVal = True
    Catch ex As Exception
    retVal = False
    End Try
    Return retVal
    End Function
    End Class
    End Namespace
    Example Usage
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim siList As New List(Of InternetConnection.SiteInfo)
    InternetConnection.SiteInfo.AddNew(siList, _
    "Test1", _
    "http://dev.virtualearth.net/REST/v1/Locations/37221?o=xml")
    InternetConnection.SiteInfo.AddNew(siList, _
    "Test2", _
    "nothing here")
    InternetConnection.SiteInfo.AddNew(siList, "Test3", _
    "www.google.com")
    InternetConnection.SiteInfo.AddNew(siList, "Test4", _
    "http://fls-online.com")
    ' This will return true:
    Dim bool1 As Boolean = _
    InternetConnection.SiteInfo.InternetIsConnected(siList, _
    "Test1")
    ' This will return false:
    Dim bool2 As Boolean = _
    InternetConnection.SiteInfo.InternetIsConnected(siList, _
    "Test2")
    ' This will return false:
    Dim bool3 As Boolean = _
    InternetConnection.SiteInfo.InternetIsConnected(siList, _
    "Test3")
    ' This will return true:
    Dim bool4 As Boolean = _
    InternetConnection.SiteInfo.InternetIsConnected(siList, _
    "Test4")
    Stop
    End Sub
    End Class
    Let me know your results please?
    Still lost in code, just at a little higher level.

  • Im syncing my iphone to itunes because i cant unlock the phone due to water damage so that i can take what is on it and put it on a new phone. how can i ensure that everything was taken from the phone and where can i find it in itunes?

    my phone recently suffered water damage so that the screen does not reigster when i slide to unlock. I am sycing the data from the phone onto itunes so i can put it onto a new phone. How can i ensure that i took everything off of the old phone before i restore it and where can i find all of that stuff when i sync with the new phone?

    iTunes will only store a back up of the iPhone and you find this by following the steps below:
    Windows
    Edit>Preferences>Devices
    Mac
    iTunes>Preferences>Devices
    The link below can show you what is stored in an iTunes back up:
    iTunes: About iOS backups

  • How can i detected that the channel is closed with nio async?

    using nio, I can wait accept, read data, write data asynchronously.
    now i make a server program, and want to dected if a socket is closed by client, how can i do this?
    thanks.

    TO: ejp
    In TCP the only way you can detect a dead connection is to attempt to write to it.
    Eventually this will fail probably with a SocketException 'connection reset'.When should this happen? I don't seem to get any expection. The socket is registered for read only but it never gets read for reading again. The appropriate selection key indicates it is writable, but I don't have it registered for write operation.
    Isn't there any other way to get around those dead sockets without trying to write at them? This would be quite an overhead, since server has to send some check_alive message periodically...

  • Sockets: How can server detect that client is no longer connected?

    Hi,
    I really need help and advice with the following problem:
    I have a Client - Server socket program.
    The server listens on port 30000 using a server socket on one machine
    The client connects to localhost on port 20000, previously creating an ssh port forward connection using the Jsch package from www.jcraft.com with
    "session.setPortForwardingL(20000, addr, 30000);"
    Then the client sends Strings to the server using a PrintWriter.
    Both are connected to each other through the internet and the server uses a dynamic dns service.
    This all works well until the IP address of the Server changes, The client successfully reconnects to the server using the dynamic dns domain name, but the server keeps listening on the old socket from the previous connection, while opening a new one for the new client connection. The server doesn't seem to notice that Client has disconnected because of this IP address change.
    looks like the server is stuck inside the while loop. If i cut the connection manually on the client side, the server seems to notice that the client has disconnected, and jumps out of the while look (see code below)
    this is the code I'm using for the server:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.Socket;
    import java.util.logging.Logger ;
    public class SocketHandler extends Thread {
        static Logger logger = Logger.getLogger("Server.SocketHandler");
        private Socket clientSocket = null;
        private BufferedReader in = null;
        private InputStreamReader inReader = null;
        public SocketHandler(Socket clientSocket) throws IOException {
            this.clientSocket = clientSocket;
            inReader = new InputStreamReader(clientSocket.getInputStream ());
            in = new BufferedReader(inReader);
        public void run() {
            try {
                String clientMessage = null;
                while ((clientMessage = in.readLine()) != null) {
                    logger.info("client says: " + clientMessage);
            } catch (IOException e) {
                logger.severe(e.getMessage());
                e.printStackTrace();
            } finally {
                try {
                    logger.info("closing client Socket: " + clientSocket);
                    clientSocket.close();
                    in.close();
                    ServerRunner.list.remove(clientSocket);
                    logger.info("currently "+ServerRunner.list.size()+" clients connected");
                } catch (IOException e) {
                    logger.severe (e.getMessage());
                    e.printStackTrace();
    }I've tried making the server create some artificial traffing by writing some byte every few seconds into the clients OutputStream. However I get no exceptions when the IP address changes. The server doesn't detect a disconnected socket connection.
    I'd really appreciate help and advice

    If a TCP/IP peer is shut down "uncleanly", the other end of the connection doesn't get the final end of connection packet, and read() will wait forever. close() sends the final packet, as will killing the peer process (the OS does the close()). But if the OS crashes or for some other reason can't send the final packet, the server never gets notification that the peer has gone away.
    Like you say, one way is timeout, if the protocol is such that there always is something coming in at regular intervals.
    The other way is a heartbeat. Write something to the other end periodically, just some kind of "hello, I'm here, ignore this message". The other end doesn't even have to answer. If the peer has gone away, TCP will retransmit your heartbeat message a few times. After about a minute it will give up, and mark the socket as broken. read() will then throw an IOException. You could send heartbeats from the client too, so that the client detects if the server computer dies.
    TCP/IP also has a TCP-level heartbeat; see Socket.setKeepAlive(). The heartbeat interval is about two hours, so it takes it a while to detect broken connections.

  • How can I detect that a step was forced to fail or forced to pass?

    When I set one step to ForceFail, and another step to ForcePass, and I run the test sequence, the ResultStatus is just "Failed" or "Passed" without providing any feedback that it was not a true test.  Is there a way to detect / document this?
    Solved!
    Go to Solution.

    I'll do you one better, here's a working example. It uses the SequenceFilePostResultListEntry callback, but you could also implement it in process model using ProcessModelPostResultListEntry. You may have to modify your stylesheet to get results to populate correctly, particularly with XML or ATML reporting.
    It's pretty simple: if the reporting step uses either Force Pass or Force Fail, the callback updates both the UI's ResultStatus and the Result.Status going into the report. If you only want one or the other, remove or comment out the part you don't want.
    Attachments:
    ForcedPostStepExample.seq ‏6 KB

  • How can I decode that MIME format value from cookie?

    Hello:
    I have a cookie that data was encode by MIME format.
    It's like this "N2eauTdoJ1lwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAGJiYXJlbAAxOS40NC41Ni4zNgB="
    So, please tell me how to decode these value?
    Thousand thanks for your help.
    Very appreciate it.

    Your cookie is formatted with Base64, it seems.
    I ran the program (below) which uses Base64 decoding and got the following result (from the string you posted):
    7g�&#9571;7h'[email protected] bbarel 19.44.56.36
    First get a free Base64 utility here (or if you already have another Base64 decoder)
    http://ostermiller.org/utils/#download
    Then use code like:
    import com.Ostermiller.util.*;
    public class Test {
         public static void main(String[] arg) {
              String encCookie = "N2eauTdoJ1lwcm9mc3B3MkB3ZWJmYXJtLmRlYXJib3JuLmZvcmQuY29tAGJiYXJlbAAxOS40NC41Ni4zNgB=";
              String cookie = Base64.decode(encCookie);
              System.out.println(cookie);
    }

  • I have iphone 4s and i did by mistake a restore with different id so i lost all my data and i got all the other id data , contacts .....etc , please how can i fix that mistake

    I have iphone 4s and i did by mistake a restore with different id so i lost all my data and i got all the other id data , contacts .....etc , please how can i fix that mistake

    How to Restore from a backup: http://support.apple.com/kb/ht1766

  • If i export my project, it runs much faster than in the canvas. How can I fix that?

    If i export my project, it runs much faster than in the canvas. How can I fix that?
    I'm from germany, sorry for my english!

    When you export your project, it is "compiled" into video format. Any player will play it at its frame rate.
    Motion is a compositing application. It has to make many more times the calculations needed to animate everything and 90% of the time, it's just not possible for Motion to keep up with "real time".  It's to be expected. Learning to live with that fact will make life a lot easier for you, I promise.
    There are a few things you can do to help speed up Motion:
    Reduce temporary play ranges to no more than about 5 seconds at a time. You can move the Play Range In and Out markers from section to section. Motion does all of its real time rendering in RAM. The longer the play range, to more it has to work managing that memory.
    Remove Preview Icons from the Layers list ( View menu > Layers Columns > Preview will toggle the views)
    When you play your animation, turn off on screen guides: (command - / will toggle onscreen guides)
    In Motion 5, reducing the quality of playback from the Render menu does not make a lot of difference anymore, so you might as well keep the default settings of Dynamic, Full and Normal on. However, Motion Blur, Frame Blending, Field Rendering, as well as the lighting options will affect playback, sometimes by quite a lot. So if you have Lights, turning off Lighting, Shadows, and Reflections will get back a lot of real time playback speed (just remember to turn on all that you need before rendering, or these things will be left out of the export!)
    HTH

  • How can I remove a tablet device that isn't there?

    In one of our test environments we've got an Xserve running OSX 10.5.6, inside is running Server 10.5 in VMWare Fusion.
    Now, the VM thinks it has a tablet device installed, as is evidenced by the ink tab showing up in system preferences (the host does not have the ink option there). Obviously there is no tablet device installed. The VM was set up by one of our IT guys who has already reinstalled it, noting no options during setup about a tablet device.
    This problem is causing one piece of software to not work in the VM, or at least, the UI doesn't. There are thousands of console messages reading "QCocoaView handleTabletEvent: This tablet device is unknown (received no proximity event for it). Discarding event"
    Question is, how can I remove the tablet device so that this software will start working? I've checked all through VMWare Fusion's options/preferences & couldn't find anything there and Googling has turned up nothing so far.

    a brody wrote:
    Since Mac OS X Server is different from Mac OS X client, I've asked a moderator to move your thread to the appropriate forum.
    Oops, my bad, but thanks.

  • HT204380 i have a mac book pro and a i-pad 2. both of the devices have the same apple id and same mailing adress. if i want to make a face-time call from my mac book to i-pad 2. how can i do that?

    i have a mac book pro and a i-pad 2. both of the devices have the same apple id and same mailing adress. if i want to make a face-time call from my mac book to i-pad 2. how can i do that?

    You have to add another email address on one of the two devices that you can use as the "You can be reached for FaceTime at" contact address and then remove/uncheck the Apple ID email address as the contact address on that device. The way you are currently setup is like to trying to call yourself on your on phone - from your own phone.
    Using the iPad as the example go to Settings>FaceTime>You can be reached for FaceTime at>Add another email address. Then add a working email address in the next window. Apple will verify the email. Go to the inbox of that email account, read and respond to Apple's email in order to complete the verification process.
    Go back to Settings>FaceTime>Uncheck the Apple ID email address and make sure that the new email address is checked/selected (you will see it being verified again) and that new email address will be your contact address for the iPad.

  • HT1296 I was using the iCloud for my iPod and had recorded an important Voice Memo on the device. Before I was able to store it on my computer, the device stopped working. I have the data on the Cloud, how can I get that back to my iMac?

    I was using the iCloud for my iPod and had recorded several irreplaceable Voice Memos. It went up to the Cloud, but I wasn't too savvy with the Cloud at that point, so it wasn't syncronizing to my home computer. So, the thing is that the iPod died and the backup is in the Cloud and I would like to load the backup to my iMac to recover my data. How can I do that? Thanks

    The new device I got to replace the iTouch is a iPad and I don't see the playlist I created with previous voice memos on it at all. Is there any way to access them on the iPad? If I erase the iPad and restore it with the old back up will the Voice Memos come along and get in to my home computer or will I be out of luck?

  • TS4006 How can I turn on my device so I can locate my stolen I Phone??? And if not; how can I pettition APPLE that there is a defect in "Find My I Phone". If its stolen do I need device to be on in order to find????

    How can I turn on my device remotely so I can locate my stolen I Phone???
    And if there is a way but I just don't know then educate me please!!!!
    And if not then how can I petition APPLE that there is a defect in "Find My I Phone".
    If its stolen I should not need device to be on in order to find unless I can turn on remotely!!!!
    Also another defect is that if the device is locked with a code then it should be really locked......
    Why is it that you can still use buttons??????........
    You should not be able to turn off unless you have the code!!!!!!
    And with that defect corrected imagine how safe it would make the consumers if everyone knew that if a phone was locked, it was really locked!!!
    Everyone would be able to find their phones and nobody could stop them from them finding their phones!!!!!
    PROBLEMS SOLVED!!!!!! NOBODY'S I PHONE WOULD EVER BE STOLEN!!!!!!
    Does anyone know can you turn on remotely??????

    You cannot turn it on remotely. Griping and complaining won't make it any better.
    What To Do If Your iDevice Is Lost Or Stolen
    If you activated Find My Phone before it was lost or stolen, you can track it only if Wi-Fi is enabled on the device. What you cannot do is track your device using a serial number or other identifying number. You cannot expect Apple or anyone else to find your device for you. You cannot recover your loss unless you insure your device for such loss. It is not covered by your warranty.
    If your iPhone, iPod, iPod Touch, or iPad is lost or stolen what do you do? There are things you should have done in advance - before you lost it or it was stolen - and some things to do after the fact. Here are some suggestions:
    This link, Re: Help! I misplaced / lost my iPhone 5 today morning in delta Chelsea hotel downtown an I am not able to track it. Please help!, has some good advice regarding your options when your iDevice is lost or stolen.
      1. Reporting a lost or stolen Apple product
      2. Find my lost iPod Touch
      3. AT&T. Sprint, and Verizon can block stolen phones/tablets
      4. What-To-Do-When-Iphone-Is-Stolen
      5. What to do if your iOS device is lost or stolen
      6. 6 Ways to Track and Recover Your Lost/Stolen iPhone
      7. Find My iPhone
      8. Report Stolen iPad | Stolen Lost Found Online
    It pays to be proactive by following the advice on using Find My Phone before you lose your device:
      1. Find My iPhone
      2. Setup your iDevice on iCloud
      3. OS X Lion/Mountain Lion- About Find My Mac
      4. How To Set Up Free Find Your iPhone (Even on Unsupported Devices)

  • HT1386 we are using same laptop with my wife for our 2 iphones and when sincronizing, she's getting my apps and is requested for my apple id and password when getting a new app on her device. How can i fix that issue?

    we are using same laptop with my wife for our 2 iphones and when sincronizing, she's getting my apps and is requested for my apple id and password when getting a new app on her device. How can i fix that issue?

    Each phone needs to set its own sync settings on the various tabs in iTunes.  On the Apps tab, for example, uncheck the apps that you don't want on the phone being synced.  This article may also be of interest: http://gigaom.com/apple/itunes-101-multiple-devices-one-itunes-account/.
    You can change the Apple ID used for purchasing on her phone by going to Settings>Store>Apple ID, tap the ID shown, sign out, sign back in using her Apple ID.  However, be aware that if she has any apps on her phone purchased with your Apple ID she will still be prompted to enter the password associated with this ID for all future updates of these apps.  This is because apps are permanently tied to the Apple ID used to purchase them, regardless of the ID in Settings>Store.

  • HT201272 I downloaded a TV show directly to my IPAD, how can I download that TV show to other devices on the same account without paying twice?

    Title says it all...
    I downloaded a TV show directly to my IPAD, how can I download that TV show to other devices on the same account without paying twice?

    Whether you can re-download them for free depends upon what country that you are in - tv shows can't be re-downloaded in all countries. If they show in the Purchased tab in the iTunes app on your other devices, or the Purchased link under Quick Links on the right-hand side of the iTunes store home page on your computer's iTunes then you can re-download them. Otherwise you can copy them from your iPad to your computer's iTunes via File > Transfer Purchases and then sync them to your other devices.

Maybe you are looking for

  • Merge to HDR problems

    when i merge to HDR my photo will not save, in fact my file menu will not open up.  what am i doing wrong?  it used to work.I have Photoshop cs5 

  • Inquiry: errors MQ555 and MQ557

    Dear Experts, I have some problems. I have migrated the asset in SAP Production Environment. Go-live date 31.05.2011. I have inserted the date transfer 31.05.2011 and Post depreciation transfer 05/2011. I have used the transaction code OASV to post t

  • Missing names

    Names are missing from phone contacts. Iphone 4.   I have toggled the Icloud contacts to no avail. Other solutions? I was asked if I wanted to update, answered yes. Then told not enough memory but took away names?  So frustrated. Thanks for any help.

  • Printing Avery Cards From Address Book

    This topic was raised in 2006 and left unanswered and archived. My wife won't use Address Book ( computer-challenged-she can't even open Mail--so it's set up to start each morning), and insists on using small Avery Rotary Cards (#5385) for names/phon

  • How to call Event ?

    How to call an event when any record is changed (Bussiness object  'Record') in Record management System ?