[android-developers] socket throws npe on activity and not on adapter

2016-08-15 Thread Ricky Manalo
i am making an app that passes some command to a socket. the app has a list 
of the sockets i can pass commands to. it also has the option to set 
schedule on when to pass a command to socket/s. passing command from the 
adapter is ok, but passing from the activity from the schedule throws npe. 
i wonder why this happens even though those codes are the same.

here's those codes;

public void willSend (final int type, final String ip, final String port, final 
int pin_id, final int status) {
new Thread(new Runnable() {
@Override
public void run() {
try {
InetAddress serverAddr = InetAddress.getByName(ip);
socket = null;
if(socket == null) {
socket = new Socket(serverAddr, Integer.parseInt(port));
}
} catch (Exception ex) {

}
if (type == 1) {
sendOpen(socket, pin_id, status);
}else {
sendClose(socket, pin_id, status);
}
}
}).start();
}

public void sendOpen (Socket socket, int pinid, int status) {
OutputStream output;
try {
abc[2] = (byte)pin_number;
abc[3] = OPEN;
if (socket.isConnected()) {
output = socket.getOutputStream();
output.write(abc);
output.flush();
//output.close();

}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{

}
}

public void sendClose (Socket socket, int pinid, int status) {
OutputStream output;
try {
abc[2] = (byte)pin_number;
abc[3] = CLOSE;
if (socket.isConnected()) {
output = socket.getOutputStream();
output.write(abc);
output.flush();
//output.close();

}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}


please help me. i don't know how to fix this anymore.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d11ed55b-fb72-4739-9a6b-40f7352af1f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] SurfaceView : Zoom Video or Video crop

2015-10-12 Thread Ricky
Hi,


I am facing one problem , related to Video Zoom  (trying to zoom a portion 
of video ).

For that I have used FrameLayout within that I am placing my SurfaceView. 

But for every change :Video is still restricted to the device's max width 
and height.

I have tried following things:
1) Changing the layout params of SurfaceView larger than the Screen . NOT 
WORKING (Video is still restricted to the device's max width and height)
2) Set the Window flag : FLAG_LAYOUT_NO_LIMITS 

 . 
and then trying to make the layout params : NOT WORKING
3) trying to set fixed with and height on surfaceCreated callback: NOT 
WORKING
4) Trying to use Androids TvView 
. by 
editing it . Where in the onLayout of the TvView was trying to do the 
changes for surfaceView (which TvView is holding) : NOTWORKING.

Other plenty of the options I have tried , but in all the cases it is  NOT 
zooming the Video if the size of surfaceView is larger than the Screen sizes

*NOTE:  *For all the above options, I was trying to remove the graphics 
plane and was observing the VideoPlane , I found:

1) For size less than screen size  : Video plane's video also re-sizing to 
the given size of SurfaceView
2) But when ever the size of surface view is larger than screen , Video 
composition is also restricted to screen max sizes and Video plane's too.

I dont want to use TextureView (Where everything like zooming and cropping 
is possible) as there is some performance issues reported.


Please Help

Thanks
Rankush
rankush.kumar1...@gmail.com







-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Child activity lifetime in background

2012-10-12 Thread Ricky
HI,

Use this tag in the manifest for the activities so that it will not get 
killed after any amount of time...

android:alwaysRetainTaskState="true"
*
*
*njoy programming*
*:)
*
On Wednesday, September 15, 2010 12:10:26 PM UTC+5:30, viktor wrote:
>
> Hi, 
>
> I have next problem, I have got parent activity and few sub- 
> activities, if app goes to the background by pressed HOME button for 
> long time, all children will be killed, and my app restart from parent 
> activity. 
>
> For example: A1 - parent, A2,A3,A4 - sub-activities. A1-->A2-- 
> >A3(top), from A3 I go to the background (HOME). wait 30-40 min and 
> restart app. 
>
> Only A1 displayed. 
>
>
> Could you please explain how to resolve my problem? 
>
> Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] i want to handling in my application, if user click "Clear Data"

2012-09-21 Thread ricky robiansyah
how to handling in my application...if user click "clear data" in manage 
application. i want back up data in the handling.
now if user click "clear data" the all data is lost in my application. some 
data is critical to the process in my application.

please help me to resolve it...
thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Auto accept Bluetooth pairing request

2011-09-26 Thread Ricky
In the Android 2.3.3 BluetoothChat example with with
createInsecureRfcommSocketToServiceRecord() API, users are still
prompted to accept the pairing request. Even though no PIN code was
presented.

Is there a way to automate Bluetooth pairing request without user
intervention? Or is this never possible due to security concerns?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AutoCompleteTextView.isPopupShowing() is always FALSE in onClick()

2011-08-10 Thread ricky
AutoCompleteTextView.isPopupShowing() is always FALSE in onClick().

How can I know that AutoCompleteTextView loose foucs and
AutoCompleteTextView's listview opened / closed?

thanks.



-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How can App not running after install apk?

2011-06-14 Thread ricky
Hi.

I install apk like below..

File file = new File(dir, "App.apk");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "application/
vnd.android.package-archive");
startActivity(intent);

in this way, installed apk run automatically after install.

But I dont want automatically running of installed app.

Is other way to install apk?


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Nexus S GRI54 cannot update to 2.3.4

2011-05-03 Thread Ricky Law
Hi all,

I am using Nexus S with Build Number GRI54, Baseband version
I9023XXKB3.
And I received the update notification Today.
After I push update and waiting, I saw a triangle with exclamation
mark during OTA.
I hold the power button and volume up button at the same time, and
screen show that update had an error 7.

Is GRI54 cannot update to 2.3.4?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Mapview ArrayIndexOutOfBoundsException in java.util.Vector.elementAt

2011-03-13 Thread Ricky
I really need some help. I have a report of a force close with this
stack trace, and I cant find any information on how to prevent this
type of error.


java.util.Vector.elementAt(Vector.java:331)
com.google.googlenav.map.Map.drawTile(Unknown Source)
com.google.googlenav.map.Map.drawMapBackground(Unknown Source)
com.google.googlenav.map.Map.drawMap(Unknown Source)
com.google.android.maps.MapView.drawMap(MapView.java:1048)
com.google.android.maps.MapView.onDraw(MapView.java:486)
android.view.View.draw(View.java:6535)
android.view.ViewGroup.drawChild(ViewGroup.java:1531)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
android.view.View.draw(View.java:6538)
android.view.ViewGroup.drawChild(ViewGroup.java:1531)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
android.view.View.draw(View.java:6538)
android.widget.FrameLayout.draw(FrameLayout.java:352)
android.view.ViewGroup.drawChild(ViewGroup.java:1531)
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
android.view.View.draw(View.java:6538)
android.widget.FrameLayout.draw(FrameLayout.java:352)
com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1830)
android.view.ViewRoot.draw(ViewRoot.java:1349)
android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:123)
android.app.ActivityThread.main(ActivityThread.java:4363)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:521)
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
dalvik.system.NativeStart.main(Native Method)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Reading/writing messages in android application

2010-11-28 Thread Ricky`


On 28 Nov, 11:32, adithya <24adit...@gmail.com> wrote:

> Can anyone tell me where can i find the constants for these column
> names ?

Managing sms is not officially supported thus is not documented but
you can take a look on provider's source code on git: http://goo.gl/l7od3

Regards

R.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] while onLongClick'ed

2010-02-15 Thread Ricky
i have search and have not found a solution to my problem.

my problem is that, i am trying to create a loop while the button is
LongClicked. currently when i long click, the moreDice() method is
only called once. i need to create a loop that will keep calling the
moreDice() untill the user nolonger LongClick's the buttton.

   here is my simple code example:

// + Button on LongClick
up.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
moreDice();
//return true because event has been handled, 
do not pass onto any
other listeners
return true;
}
});

thanks in advanced,
-ricky

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en