Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: hexadecimal code to text

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hexadecimal code to text

    hi..
    i am new in android programming
    i am just doing a project with pic controller.in this project the pic controller will generate some some hexadecimal code with change in voltage levels .this code will be send to mobile via bluetooth module to my android mobile..
    i just need a android project that could convert the hexadecimal code being trasmitted to phone is converted into text and then to speech.
    please kindly help me with this ..
    Thank you in Advance
    God Bless
    Regards ..Nikhil


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: hexadecimal code to text

    convert the hexadecimal code ... into text
    Can you give an example? What is the hexadecimal code? Is it a String: "41" which would convert to "A"
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hexadecimal code to text

    Quote Originally Posted by Norm View Post
    Can you give an example? What is the hexadecimal code? Is it a String: "41" which would convert to "A"
    hi Norm !!!

    Let me explain exactly how our project works.
    we are using pic16f877a microcontroller, we will be transmitting hex values from the pic via bluetooth.
    now coming to the android app, we want to create the app in such a way that it will receive this hex value via bluetooth, display it and then read it.

    The hex value is for individual alphabets and not an entire word.
    eg if i want to display A ,

    The hex value ie 41 will be sent via bluetooth to the phone and now the app needs to detect it and display A.
    once a whole word is displayed eg,APPLE then the app should speak it out !!!

    Please do help us !!!
    Thanks and God Bless!!!
    TONY

  4. #4
    Junior Member
    Join Date
    Feb 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: hexadecimal code to text

    Thanks for ur response. yeha ... if the string is "48656c6c6f" it should convert to "Hello"

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: hexadecimal code to text

    If you have a String of hex characters, take them 2 at a time, convert the 2 letters to an int (using Integer class's parseInt()) and cast that to a char.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Java code Split text file into multiple text file
    By jayraj in forum What's Wrong With My Code?
    Replies: 26
    Last Post: April 19th, 2013, 06:14 AM
  2. Hexadecimal to Binary WITH leading zeros???
    By Deprogrammer in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 6th, 2012, 09:27 PM
  3. Decimal to Hexadecimal, Without Java Libraries.
    By ribmant in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 3rd, 2012, 07:28 AM
  4. How to convert a String into an Hexadecimal ?
    By lumpy in forum Java Theory & Questions
    Replies: 2
    Last Post: February 16th, 2010, 05:01 PM
  5. Hexadecimal answer rather than decimal
    By Eric in forum Java Theory & Questions
    Replies: 1
    Last Post: June 22nd, 2009, 11:36 AM