Android :: Defining Data Encoding Of SMS Messages

Aug 24, 2010

I'm working on an application using the SMS apis for android. The receiving end is an embedded unit that only supports 7-bit encoded SMS and the string I'm sending consists only of symbols from this particular alphabet which makes you think that Android is going to send it encoded as 7 bit. But that is not the case.Therefore I'm searching for a way to specify what encoding to use. See below for what my code looks like today. The method gsm7BitPackedToString turns a byte-array to a 7-bit string, i.e. the string only consists of 7-bit compatible characters and is copied from the internal android api. Code...

Android :: Defining data encoding of SMS messages


Android :: Convert InputStream To String With Encoding Given In Stream Data?

May 20, 2010

My input is a InputStream which contains an XML document. Encoding used in XML is unknown and it is defined in the first line of XML document.
From this InputStream, I want to have all document in a String.

To do this, I use a BufferedInputStream to mark the beginning of the file and start reading first line. I read this first line to get encoding and then I use an InputStreamReader to generate a String with the correct encoding.

It seems that it is not the best way to achieve this goal because it produces an OutOfMemory error.

Any idea, how to do it ? code...

View 1 Replies View Related

Android :: Multiple Broadcast Messages With Less Data Or Less Broadcast Messages With More Data

Oct 5, 2009

I am developing an application which is communicating with the server. Tha application can perform log-in and get different parameters from server.

The application consists of a RESTful client (custom class for making requests), Communication Service (the service which runs in the background) and the main activity.

For now I created multiple broadcast messages and multiple broadcast receivers in the main activity so when the application performs login operation a receiver (loginBroadcastReceiver) in the main activity receives a message and when another parameter is received from the server different message is broadcasted and another receiver handles the message.

This way however the application performance is poor but I am not sure whether it is due to multiple broadcast receivers.

Does anyone know what is the best way to exchange data between service and main activity - is it better to create a single broadcast receiver and retrieve all parameters from message or is it better to initialize multiple broadcast receivers for multiple parameters?

View 1 Replies View Related

Android :: Web View Encoding? Why?

May 28, 2010

I have started to work with the WebView component of Android Platform, but the API to load data to the component is confusing me, because it includes a parameter with a encoding. In both methods: public void loadData (String data, String mimeType, String encoding); public void loadDataWithBaseURL (String baseUrl, String data, String mimeType, String encoding, String historyUrl); you have to specify an encoding. In both cases, the API documentation says that is is the encodign of the data (data parameter). Well, as know, if you provide data as a String object, the String is internally stored in UTF-16 (unicode). To get a String object from a external source, you need to specify the external source encoding to convert it to UTF-16 and get the String internal representation (String(byte[] data, String encoding)). So, at this moment, when you have an String instance, everything from the original source has been converted to UTF-16. So, why do you need to specify an encoding if you are providing the data as a String object?

I don't know the internal implementation of WebKit, but let's suppose that, WebKit has a method, to render a source, providing as content an InputStream and a default encoding. Well, as I know, when you process a HTML page, you use the default encoding to read the HTML characters, and if you find a <meta> tag specifing a different encoding, from that moment, you have to use the new encoding to decode the characters of the HTML page. But what happens if you supply a HTML page that contains this <meta> tag: <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=ISO-8859-1"/> using one of the methods specified at the top of this post, how are you going to read ISO-8859-1 encoding from a String that it is in UTF-16 encoding? if the WebKit filtering this <meta> tags, and doesn't taking in account the encoding specified in this tag? Well, all of this is very confusing for me, because I don't understand why the API includes this encoding parameter. I also don't know if the <meta> encoding tags are filtered when the source is provided as a String? Can anyone solve my doubts?

View 2 Replies View Related

Android :: Defining A Callback Function For A Given Value

Sep 13, 2010

In Java, is it possible to associate some object (i.e. a String) with a function to be called ? I have two similar menus and both have a onClickListener with some code like this: Code...

View 4 Replies View Related

Android :: Defining Selector Drawable

Feb 14, 2009

I am trying to setup a selector drawable in my asset file like this: * 2 different images for 'on'/'off' mode in rest mode (i.e. it does not has focus) * another 2 different images for 'on'/'off' mode in focus mode (i.e. it has the focus). In my case, the rest mode works, but the 'focus' mode does not. Can you please tell me what am I missing in the focus mode? Code...

View 4 Replies View Related

Android :: Is Runtime Mapview Defining Possible?

Jun 26, 2010

I've been trying to use a mapView in my app, and have been following the tutorial; http://developer.android.com/resources/tutorials/views/hello-mapview. Code...

View 5 Replies View Related

Android :: Defining Custom Attrs

Aug 9, 2010

I need to implement my own attributes like in com.android.R.attr Found nothing in official documentation so I need information about how to define these attrs and how to use them from my code.

View 1 Replies View Related

Android :: How To Check Encoding In Java

Nov 19, 2010

I am facing a problem about encoding.

For example,
I have a message in xml format encoding is "UTF-8".

CODE:.........

Now, this message are supporting multiple language.
Traditional Chinese (big5), Simple Chinese (gb), English (utf-8)

And it will only change the encoding in specific fields.
For example (Traditional Chinese),

CODE:..........

Only "蘋果" and "橙" are using big5, "<product_name>" and "</product_name>" stills in use utf-8.
<price>1.3</price> and <price>1.2</price> are using utf-8.

How do I know which word is using different encoding?

View 3 Replies View Related

Android :: Make Own UI Defining My Properties?

Jul 8, 2010

How can I make my own UI defining my properties?

View 2 Replies View Related

Android :: Defining Layout Resources In A Modular Way?

Oct 9, 2009

Is there a way to define xml layout resources in a modular way? I am building individual 'panels' through code only, it would probably make sense if each were defined in their own xml file, which I can pull at runtime, something like the following pseudopod: Code...

View 2 Replies View Related

Android :: Defining Width For Spinners Options

Dec 10, 2009

I am using spinners in my application, but when I click the drop down icon the options coverthe entire width of the screen. But I want the options to cover only some part of the screen(ie.. width). By using LayoutParams I am able to change only the spinner icon width but not the options width. I even searched for it,but of no use. Any one help me, I need it very badly.

View 5 Replies View Related

Android :: Defining An XML Vertical Line Drawable

Apr 18, 2010

I'm trying to figure out how to define a verical line (1px thick) to be used as a drawable. to make a horizontal one, it's pretty straightforward: Code...

View 4 Replies View Related

Android :: Defining A Shape Xml Element In Drawable?

Dec 23, 2009

I dropped the following into the drawable directory in my Android 1.5 project: Code...

View 1 Replies View Related

Android :: Difference Between Defining A Value In Color / Drawable Tag ?

Sep 19, 2010

This is some part of the colors.xml from android samples directory. Now my question is that, what is the difference between defining a color in <drawable> tag and <color> tag ?

View 1 Replies View Related

Android :: Default Encoding Of Operating System?

Feb 5, 2010

What is the default encoding of android system?

View 1 Replies View Related

Android :: What Xml Encoding Work For Non European Languages

Mar 15, 2010

Assume I want to write an xml resource file with a a non-europian language, say japanese, thai or chinese-What encodings can I use and what do I have to to to both the xml header and the Writer to makes these work - Also is there an easy way to map a Locale into acceptable encodings

View 4 Replies View Related

Android : Way To Update SDK / Support Encoding Qcelp

Apr 8, 2009

I've added one new feature to Opencore & Framework to let them support encoding qcelp. But I found that Eclipse cannot figure out this new feature, e.g.

recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_QCELP);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.QCELP);

Eclipse now does not think RAW_QCELP & QCELP as legal symbols. So, what should I do to update the SDK to pass though this issue? Overwrite its system.img, boot.img or some *.jar packages?

View 3 Replies View Related

Android :: Defining Set Values For Seekbar Widget To Snap

May 30, 2009

Is there a way to define set values (i.e. 0%, 25%, 50%, 75%, 100%) for the seekbar widget that enables the slider to "snap" to the nearest set value? For example instead of allowing the user to position the slider at an percentage through 0-100, instead the slider can only ever be positioned at one of the five set values? While were on the subject is there an easy solution for positioning the seekbar vertically, I'd rather not hack through the seekbar source code - but I fear I may have to!

View 3 Replies View Related

Android :: Defining A Scroll View Without Setting Its Height

Aug 24, 2010

I created a ScrollView and want it to expand to the available space, without having to set a fixed height (i.e. "250px") for it. As such, I created a Relative Layout. The basic outline follows: Code...

View 1 Replies View Related

Android :: Creating Custom Widgets / Defining Properties In XML For Them

Jul 29, 2009

I would like to create a widget that can reads its attributes from an XML file onCreate. I've created a Custom Button that extends Button widget. I would like to define its layout and styling in an XML, such that the widget can be reused across different views, with the same styling attributes. The notepad sample code does carry some pointers to this problem, however, it defines a XML layout with the component as View, inside LinearLayout, which is not really what I'm trying to achieve here.

View 4 Replies View Related

Android :: Chunked Encoding - GZIP Input Stream

Mar 3, 2010

I found a problem with GZIP input stream when wrapping InputStream from HttpURLConnection. When the server response with Transfer- Encoding=chunked, Content-Encoding=gzip and Connection=Keep-Alive. The second post always return -1. After digging into the source code, I found the place that could be a bug: InflaterInputStream.java (line 190 to 192) if (inf.needsInput()) { fill(); } Because InflaterInputStream doesn't need more input, it doesn't try to read the end of chunked encoding (0x)(30 0a 0d) that cause the second post to return with -1 every time.

View 3 Replies View Related

Android :: Http Proxy And Chunked Encoding With Emulator

Mar 24, 2009

I am having a specific problem that is preventing me using the android SDK from work. We are using a MS Proxy here that all internet traffic has to go through. The problem seems to be when the emulator is trying to access a site that uses 'Transfer-Encoding: chunked' If I attempt to download www.nds.com (no chunked encoding) into the browser, it works fine. However if I try to go to www.google.com (uses chunked encoding), the browser fails with the message: can't determine content length, and client wants to keep connection opened My feeling (and I'm no expert in this area) is that the underlying code managing the communication through the proxy is not dealing with the null terminator on the chunk encoded response when the connection to the proxy is being kept open? Does anyone have any experience in this area? Is the source to the emulator available so I can try and understand what is going on here?

View 8 Replies View Related

Android :: Reading Defining Line Of Text File In Java

Oct 2, 2010

I am trying to develop application for android . how I can get the defining line of textfile? For instance I have to read 15. line of textfile. how I can do that?

View 1 Replies View Related

Android :: What Is Point Of Defining Actions Within Intent Filters On A Receiver Tag

Apr 15, 2010

I'm currently exploring Broadcast Receivers and Broadcast Intent. There are some aspects of the tutorials which are ambiguous to me. To my knowledge this is how the process works. I can broadcast an intent from my application and any receiver on the phone can act on that intent as long as the actions match. I can register a broadcaster receiver on anything that extends Context and when I do so I must provide a filter which will allow the receiver to act on one or more intent actions.The part which confuses me is defining a receiver via the manifest. Must the name of said receiver match a class name? Why should I ever define an intent filter with an action in the project manifest if I always have to provide another intent filter when I register my receiver in code?

View 1 Replies View Related

Android :: Sending And Receiving Data Messages Via A BroadcastReceiver

Feb 15, 2009

Is there already functionality similar to the push registry or wireless messaging API in J2ME implemented in Android? Or at least plans to do so?I have been looking at this issue for a while, because in a corporate environment it is essential to be able to push information out, or trigger actions via SMS or other connections.I have successfully sent an SMS between emulator instances, and successfully received an SMS by using a BroadcastReceiver on another emulator instance. I have also been able to use SmsManager. sendDataMessage to send a data message to a port on another emulator instance, but in this case the BroadcastReceiver is never triggered. This seems to be the closest the API's get to what I'm looking for.

View 3 Replies View Related

Android :: Independent Thread That Executes While Creating Layout And Defining Activity?

Jun 3, 2010

The android docs say that it adds the runnable to the queue and it runs in the UI thread. What does this mean? So, for example, the same thread I use to create my layout is used to run the Runnable? What if I want it as an independent thread that executes while I am creating my layout and defining my activity?

View 2 Replies View Related

Android :: Recovering Deleted Messages / Data On A Mobile Phone

Feb 22, 2010

I want to design a mobile application/tool for recovering deleted messages/pictures/files from the phone. I have the choice to do that using Android or Symbian. what do you think is more easier provided that I have to use some operating system concepts to solve the problem and recover deleted messages. Also what are the concepts that I can use for recovery ?

View 3 Replies View Related

Android : App To Record Calls Duration - Messages And Data Used Through Phone?

Mar 23, 2010

I have been having problem with the carrier, they use to say I have called many numbers and have sent many SMSs I didn't really call or send.

So I was wondering if there is an app which will record all the calls' duration, SMSs sent and 3G/Edge usage.

So I could have a report later and compare it to my phone bill.

View 2 Replies View Related

Android :: File's Chinese Characters Can't Be Displayed / Droid Support ANSI Encoding These?

Aug 26, 2009

I have two text file, both of them contains Chinese characters, one text file is saved using ANSI encoding, but this file's Chinese characters can not be displayed by htmlviewer on the phone. The Chinese characters in another txt file saved using unicode can be displayed ok by htmlviewer. Do you have any suggestions on this, does Chinese characters using ANSI encoding supported?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved