HTC Magic, is PhoneNumberUtils.PAUSE different?

by Alejandro » Mon, 27 Apr 2009 12:37:42 GMT


Sponsored Links
 I am getting reports that the in the HTC Magic the character that
represents the pause in a dial string is different than in the Google
build of cupcake. In the SDK 1.5 pre-release, the pause is given by a
','. Apparently, in the HTC magic, the pause is given by a 'p'.
Unfortunately, I don't currently have the means to test this. Does
anyone know if the PhoneNumberUtils.PAUSE member in the HTC magic
build reflects this change? Have any other functions in
PhoneNumberUtils changed in order to support this?

Thank you,
Alejandro

--~--~---------~--~----~------------~-------~--~----~



HTC Magic, is PhoneNumberUtils.PAUSE different?

by Alejandro » Thu, 25 Jun 2009 14:05:38 GMT


 The Rogers HTC Magic phone is using the 'p' as a pause, but it seems
they haven't changed the PhoneNumberUtils.PAUSE to reflect this. This
is rather unfortunate, because it makes the Rogers build non-standard
and my app breaks. I would hope in the future there are no more
deviations of the standard SDK, otherwise, developing for the Android
platform will become harder.

Alejandro





--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. ListActivitiy

i wanna make an option on my account list that i block person(make it
disable) my problem is that i need a warning message to confirm the
operation;For example if I click it gives me a block account dialog
 !! O.o how to do it
code
import android.app.ListActivity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class MainListActivity extends ListActivity  {

        private static final int ITEM_VIEW_TYPE_VIDEO = 0;
        private static final int ITEM_VIEW_TYPE_SEPARATOR = 1;
        private static final int ITEM_VIEW_TYPE_COUNT = 2;

        private static class Video {
                public String title;
                public String description;

                public Video(String title) {
                        this(title, "ok");
                }

                public Video(String title, String description) {
                        this.title = title;
                        this.description = description;
                }
        }

        private static final Object[] OBJECTS = { "Compte",
                        new Video("bloquer compte"), new Video("dbloquer le 
compte "),
                        new Video("changer code de scurit par sms "),
                        new Video("Virement par SMS "),
                        new Video("Annuler Virement par SMS "),
                        new Video("consulter votre solde  "),





                 "opration fianire",
                        new Video("paipement par sms "), new Video("recharge 
fix et GSM"),

                        new Video("chargement"), new Video("Transfer Spcial 
par SMS"),
                 "suvie"
                 };

        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.liste);

                setListAdapter(new VideoAdapter());
        }

        private class VideoAdapter extends BaseAdapter {

                @Override
                public int getCount() {
                        return OBJECTS.length;
                }

                @Override
                public Object getItem(int position) {
                        return OBJECTS[position];
                }

                @Override
                public long getItemId(int position) {
                        return position;
                }

                @Override
                public int getViewTypeCount() {
                        return ITEM_VIEW_TYPE_COUNT;
                }

                @Override
                public int getItemViewType(int position) {
                        return (OBJECTS[position] instanceof String) ?
ITEM_VIEW_TYPE_SEPARATOR
                                        : ITEM_VIEW_TYPE_VIDEO;
                }

                @Override
                public boolean isEnabled(int position) {
                        // A separator cannot be clicked !
                        return getItemViewType(position) != 
ITEM_VIEW_TYPE_SEPARATOR;
                }

                @Override
                public View getView(int position, View convertView, ViewGroup
parent) {

                        final int type = getItemViewType(position);

                        // First, let's create a new convertView if needed. You 
can also
                        // create a ViewHolder to speed up changes if you want 
;)
                        if (convertView == null) {
                                final LayoutInflater inflater =
LayoutInflater.from(MainListActivity.this);
                                final int layoutID = type == 
ITEM_VIEW_TYPE_SEPARATOR ?
R.layout.separator_list_item : R.layout.video_list_item;
                                convertView = inflater.inflate(layoutID, 
parent, false);
                        }

                        // We can now fill the list item view with the 
appropriate data.
                        if (type == ITEM_VIEW_TYPE_SEPARATOR) {
                                ((TextView) convertView).setText((String) 
getItem(position));
                        } else {
                                final Video video = (Video) getItem(position);
                                ((TextView) 
convertView.findViewById(R.id.title))
                                                .setText(video.title);
                                ((TextView) 
convertView.findViewById(R.id.description))
                                                .setText(video.description);
                        }

                        return convertView;
                }

        }
}

-- 

2. Support SCTP in Android

Hello,may i ask some questions about Support SCTP in Android?

i have modified my kenerl Config file by  "CONFIG_IP_SCTP=m" and "insmod
sctp.ko" is success .

i hava done some simple client/server console application , but the function
"connect" always failed by "Connection timed out" .The client and server
concole application works well on my ubuntu host machine,but when i
Cross-compile it to run on Android emulator , it won't mork well , the
client request server_addr "127.0.0.1" , use port 9999 , the server listen
on port 9999 , but the connection won't been established . Can anyone tell
me what should i do ? Thank you .

And i did't integrated lksctp tools in android , can anyone tell me
how to integrated
it?

The mail attachment is the code of my test concole application.

My English is poor , please forgive that .

Please help me . Thank you .

-- 

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
//#include <netinet/sctp.h>
#include <arpa/inet.h>

#include "sctp.h"

#define MAX_BUFFER 1024
#define MY_PORT_NUM 9999

int main()
{
   int cfd;
   int ret,in,flags;
   char buffer[MAX_BUFFER+1];
   struct sockaddr_in sersddr;
   struct sctp_event_subscribe events;
   struct sctp_initmsg initmsg;
   struct sctp_status status;
   struct sctp_sndrcvinfo sndrcvinfo;

   cfd = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP);
	printf("Client : socket fd = %d\n",cfd);
   if ( cfd == -1 )
   {
      perror( "Socket error!" );
      exit(1);
   }

   bzero( &initmsg, sizeof(initmsg) );
   memset( &initmsg, 0, sizeof(initmsg) );
   initmsg.sinit_num_ostreams = 5;
   initmsg.sinit_max_instreams = 5;
   initmsg.sinit_max_attempts = 4;
   ret = setsockopt( cfd, IPPROTO_SCTP, SCTP_INITMSG, (void *)&initmsg, (socklen_t)sizeof(initmsg));
   if (ret < 0)
   {
      perror( "Setsockopt SCTP_INITMSG error!" );
      exit(1); 
   }
	printf("Client : setsockopt return value : %d\n",ret);
   
   
   bzero( &sersddr, sizeof(sersddr));
   sersddr.sin_family = AF_INET;
   sersddr.sin_port = htons (MY_PORT_NUM);
   sersddr.sin_addr.s_addr = inet_addr( "127.0.0.1" );
	printf("Client : trying to connect...\n");
   ret = connect( cfd, (struct sockaddr *)&sersddr, sizeof(sersddr));
   if (ret == -1)
   {
      perror( "Bind error" );
      exit(1);
   }
   printf("Client : connect success.\n");
   bzero( &events, sizeof(events));
   memset( (void *)&events, 0, sizeof(events) );
   events.sctp_data_io_event = 1;
   ret = setsockopt( cfd, IPPROTO_SCTP, SCTP_EVENTS, (void *)&events, (socklen_t)sizeof(events));
   if (ret < 0)
   {
      perror( "Setsockopt SCTP_EVENTS error!" );
      exit(1); 
   }

   in = sizeof(status);
   ret = getsockopt( cfd, IPPROTO_SCTP, SCTP_STATUS, (void *)&status, (socklen_t*)&in);
   if (ret < 0)
   {
      perror( "Getsockopt SCTP_STATUS error!" );
      exit(1); 
   }
  
   ret = sctp_recvmsg( cfd, (void *)&buffer, sizeof(buffer), NULL, 0, &sndrcvinfo, &flags);
   if (ret > 0)
   {
      buffer[ret] = 0;
      printf( "%s\n", buffer );
      printf( "All rigth!\n" );
   }
  
   close( cfd );
   return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>

#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
//#include <netinet/sctp.h>
#include "sctp.h"

#define MAX_BUFFER 1024
#define MY_PORT_NUM 9999
#define LISTEN_LEN 5

int main()
{
   int lsd,asd;
   int ret;
   int stream_num = 1;
   time_t currenttime;
   char buffer[MAX_BUFFER+1];
   struct sockaddr_in seraddr;
   struct sctp_initmsg initmsg;
   
   lsd = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP );
	printf("Server : socket fd = %d\n",lsd);
   if (lsd == -1)
   {
      perror( "Socket error!" );
      exit(1);
   }

   bzero( &seraddr, sizeof(seraddr));
   seraddr.sin_family = AF_INET;
   seraddr.sin_port = htons( MY_PORT_NUM );
   seraddr.sin_addr.s_addr = INADDR_ANY;

   ret = bind( lsd, (struct sockaddr *)&seraddr, sizeof(seraddr));
   if (ret == -1)
   {
      perror( "Bind error!" );
      exit(1);
   }
	printf("Server : bind return value : %d\n",ret);
   bzero( &initmsg, sizeof(initmsg));
   initmsg.sinit_num_ostreams = 5;
   initmsg.sinit_max_instreams = 5;
   initmsg.sinit_max_attempts = 5;
   ret = setsockopt( lsd, IPPROTO_SCTP, SCTP_INITMSG, &initmsg, sizeof(initmsg));
   if (ret < 0)
   {
      perror( "Setsockopt SCTP_INITMAG error!" );
      exit(1); 
   }
	printf("Server : setsockopt return value : %d\n",ret);
   ret = listen( lsd, LISTEN_LEN);
   if (ret == -1)
   {
      perror( "Listen error!" );
      exit(1);
   }

   while (1)
   {
      printf( "Waiting for a new association\n" );
      asd = accept( lsd,  (struct sockaddr *)NULL, (int *)NULL);
      
      if (asd == -1)
      {
      perror( "Accept error!" );
      exit(1); 
      }
	printf("connection established\n");
      currenttime = time( NULL );
      
      snprintf( buffer, MAX_BUFFER, "%s", ctime( &currenttime ));
      sctp_sendmsg( asd, (void *)buffer, (size_t)strlen(buffer), NULL, 0, 0, 0, stream_num, 0, 0);
   
      close(asd);
   }

   close(lsd);
   return 0;
}

3. Garbage collector hangs OpenGL on HTC Evo

4. how could i remove this pop-up message process com.google.process.gapps , android phone

5. string-arrays

6. Debug/Run Application directly on device

7. Not able to install android packages