Search Results

Search found 8 results on 1 pages for 'shrikant'.

Page 1/1 | 1 

  • GCM: onMessage() from GCMIntentService is never called [migrated]

    - by Shrikant
    I am implementing GCM (Google Cloud Messaging- PUSH Notifications) in my application. I have followed all the steps given in GCM tutorial from developer.android.com My application's build target is pointing to Goolge API 8 (Android 2.2 version). I am able to get the register ID from GCM successfully, and I am passing this ID to my application server. So the registration step is performed successfully. Now when my application server sends a PUSH message to my device, the server gets the message as SUCCESS=1 FAILURE=0, etc., i.e. Server is sending message successfully, but my device never receives the message. After searching alot about this, I came to know that GCM pushes messages on port number 5228, 5229 or 5230. Initially, my device and laptop was restricted for some websites, but then I was granted all the permissions to access all websites, so I guess these port numbers are open for my device. So my question is: I never receive any PUSH message from GCM. My onMessage() from GCMIntenService class is never called. What could be the reason? Please see my following code and guide me accordingly: I have declared following in my manifest: <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" /> <permission android:name="package.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <!-- App receives GCM messages. --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- GCM connects to Google Services. --> <uses-permission android:name="android.permission.INTERNET" /> <!-- GCM requires a Google account. --> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <!-- Keeps the processor from sleeping when a message is received. --> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="package.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="packageName" /> </intent-filter> </receiver> <receiver android:name=".ReceiveBroadcast" android:exported="false" > <intent-filter> <action android:name="GCM_RECEIVED_ACTION" /> </intent-filter> </receiver> <service android:name=".GCMIntentService" /> /** * @author Shrikant. * */ public class GCMIntentService extends GCMBaseIntentService { /** * The Sender ID used for GCM. */ public static final String SENDER_ID = "myProjectID"; /** * This field is used to call Web-Service for GCM. */ SendUserCredentialsGCM sendUserCredentialsGCM = null; public GCMIntentService() { super(SENDER_ID); sendUserCredentialsGCM = new SendUserCredentialsGCM(); } @Override protected void onRegistered(Context arg0, String registrationId) { Log.i(TAG, "Device registered: regId = " + registrationId); sendUserCredentialsGCM.sendRegistrationID(registrationId); } @Override protected void onUnregistered(Context context, String arg1) { Log.i(TAG, "unregistered = " + arg1); sendUserCredentialsGCM .unregisterFromGCM(LoginActivity.API_OR_BROWSER_KEY); } @Override protected void onMessage(Context context, Intent intent) { Log.e("GCM MESSAGE", "Message Recieved!!!"); String message = intent.getStringExtra("message"); if (message == null) { Log.e("NULL MESSAGE", "Message Not Recieved!!!"); } else { Log.i(TAG, "new message= " + message); sendGCMIntent(context, message); } } private void sendGCMIntent(Context context, String message) { Intent broadcastIntent = new Intent(); broadcastIntent.setAction("GCM_RECEIVED_ACTION"); broadcastIntent.putExtra("gcm", message); context.sendBroadcast(broadcastIntent); } @Override protected void onError(Context context, String errorId) { Log.e(TAG, "Received error: " + errorId); Toast.makeText(context, "PUSH Notification failed.", Toast.LENGTH_LONG) .show(); } @Override protected boolean onRecoverableError(Context context, String errorId) { return super.onRecoverableError(context, errorId); } }

    Read the article

  • Novice developer

    - by Shrikant
    Sir. I'm a student of B.Tech final year from the CSE branch. I'm using Ubuntu since the last 3 years. It gave me a lot of knowledge. So now I want to repay Ubuntu back by developing some apps for Ubuntu, but I don't know which language I should choose: Java, C or C++ or something else. So please, guide me how to start. I have intermediate knowlegde of C, C++ , Java & Linux scripts. So in which language should i start? I don't have any live software development knowledge so explain me everything. Thank you

    Read the article

  • cx_Oracle makes subprocess give OSError

    - by Shrikant Sharat
    I am trying to use the cx_Oracle module with python 2.6.6 on ubuntu Maverick, with Oracle 11gR2 Enterprise edition. I am able to connect to my oracle db just fine, but once I do that, the subprocess module does not work anymore. Here is an iPython session that reproduces the problem... In [1]: import subprocess as sp, cx_Oracle as dbh In [2]: sp.call(['whoami']) sharat Out[2]: 0 In [3]: con = dbh.connect('system', 'password') In [4]: con.close() In [5]: sp.call(['whomai']) --------------------------------------------------------------------------- OSError Traceback (most recent call last) /home/sharat/desk/calypso-launcher/<ipython console> in <module>() /usr/lib/python2.6/subprocess.pyc in call(*popenargs, **kwargs) 468 retcode = call(["ls", "-l"]) 469 """ --> 470 return Popen(*popenargs, **kwargs).wait() 471 472 /usr/lib/python2.6/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags) 621 p2cread, p2cwrite, 622 c2pread, c2pwrite, --> 623 errread, errwrite) 624 625 if mswindows: /usr/lib/python2.6/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) 1134 1135 if data != "": -> 1136 _eintr_retry_call(os.waitpid, self.pid, 0) 1137 child_exception = pickle.loads(data) 1138 for fd in (p2cwrite, c2pread, errread): /usr/lib/python2.6/subprocess.pyc in _eintr_retry_call(func, *args) 453 while True: 454 try: --> 455 return func(*args) 456 except OSError, e: 457 if e.errno == errno.EINTR: OSError: [Errno 10] No child processes So, the call to sp.call works fine before connecting to oracle, but breaks after that. Even if I have closed the connection to the database. Looking around, I found http://bugs.python.org/issue1731717 as somewhat related to this issue, but I am not dealing with threads here. I don't know if cx_Oracle is. Moreover, the above issue mentions that adding a time.sleep(1) fixes it, but it didn't help me. Any help appreciated. Thanks.

    Read the article

  • Accessing ArrayList in Javascript - ASP.Net MVC2

    - by Shrikant
    Hi I have ArrayList in my Model and want to iterate through it in my javascript. I am using following code but its giving me error : CS0103: The name 'i' does not exist in the current context for(var i=0; i <= <%=Model.KeyList.Count%>; i++) { alert('<%=Model.KeyList[i]%>'); } How to get rid of this. its urgent...Please.

    Read the article

  • variable argument list in windows va_list

    - by shrikant
    hi, I wanted to have function which will accept as foo(...) { } usage of this would be foo(1,2,3); foo(1) foo(1,2,3,4,5,5,6); va_list can be used but again for that I have to pass foo(int count, ...), as this at run time i dont know how many argument i have. any pointer would be appreciated Thanks

    Read the article

  • EOF error encountered while converting bytearray to bitmapdata

    - by intoTHEwild
    I am using var bitmapdata:BitmapData=new BitmapData(); var pixels:Bytearray=new Bytearray(); pixels = rleDecodePixles(); bitmapdata.setPixels(bitmapdata.rect, pixels); In the 4th line in the code above i am getting "Error: Error #2030: End of file was encountered." I checked the length of the pixels object which is 4 times the width*height of the rect object. Given that setPixels() functions reads unsigned int from bytearray and sets that value to pixels, I think it should work. But I have no clue why this wont work. The pixels object is filled after RLE decoding of the data which i get from a server. Is there any work around or any other method which I could try to use. The loader class wont work as the data that I get from the server is not in any of the recognized format. Any help is greatly appreciated. Shrikant Thanks.

    Read the article

1