yashsingh1/xdaforums huggingface dataset:
[Java for Android App Development] warlock9_0:
forget the execute().get() for now, maybe it is not needed

read the documents for asynctask and change your result type from void, to whatever you want to set

for example if you want only the PrintWriter to be set you can do this

package com.example.sensorsmart;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

import android.app.Activity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity implements SensorEventListener{

private static final int SERVERPORT = 8222;
private static final String SERVER_IP = "192.168.0.101";
private SensorManager mSensorManager;
private Sensor mAccelerometer;
private TextView tv ;
public ServerSocket serverSocket=null;
public Socket socket = null;
public BufferedReader in ;
public BufferedWriter out;
public PrintWriter pw ;
public FileWriter writer=null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new MyTask().execute();
mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
mAccelerometer mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
mSensorManager.registerListener(this, mAccelerometer,SensorManager.SENSOR_DELAY_NORMAL);
}
public void onStopClick(View view) {
mSensorManager.unregisterListener(this);}

private class MyTask extends AsyncTask<Void, Void, PrintWriter>
{
@Override
protected PrintWriter doInBackground(Void... arg0) {

try {
serverSocket = new ServerSocket(8222);
} catch (IOException e) {
e.printStackTrace();
}
try {
socket=serverSocket.accept();
Log.i("TcpServer", "CONNECTED");
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
pw = new PrintWriter(socket.getOutputStream(),true);
if(!in.ready())
{
Log.i("TcpServer", "READER IS NOT READY");
}

final String g;
final String c;
String b = null;
Log.i("TcpServer", "GOING");
g=in.readLine();
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(),g, Toast.LENGTH_LONG).show();
}
});

} catch (IOException e) {
e.printStackTrace();
String response = e.getCause().toString();
Log.i("TCP",response);
}
return pw;
}

protected void onPostExecute(PrintWriter result) {
pw = result;
}
}

@Override
public void onSensorChanged(SensorEvent event) {
float x = event.values[0];
float y = event.values[1];
float z = event.values[2];
if(pw!=null) pw.write("g"); //NULL POINT EXCEPTION THROWS HERE
}
}

if you want other variables to be returned too, you can make a custom object as the type of the result
[Java for Android App Development] flavglen:
is it possible to pass socket instead mof printwriter?

hi friend thank u for ur reply...is it possible to pass socket in onpostexecute () ?

i tried with below code still socket is null in ONsensor Changed

private class MyTask extends AsyncTask<Void, Void,Socket>

{

@Override
protected Socket doInBackground(Void... arg0) {
// TODO Auto-generated method stub

try {
serverSocket = new ServerSocket(8222);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

try {
socket=serverSocket.accept();

Log.i("TcpServer", "CONNECTED");

in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

pw = new PrintWriter(socket.getOutputStream(),true);

//out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));

if(!in.ready())
{
Log.i("TcpServer", "READER IS NOT READY");
}

final String g;
final String c;

String b = null;

Log.i("TcpServer", "GOING");

g=in.readLine();

//Log.i("TcpServer", in.readLine());

runOnUiThread(new Runnable() {
public void run() {

Toast.makeText(getApplicationContext(),g, Toast.LENGTH_LONG).show();

}
});

Log.i("TcpServer", "RECEIVED");

runOnUiThread(new Runnable() {
public void run() {

Toast.makeText(getApplicationContext(),g, Toast.LENGTH_LONG).show();

}
});

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

String response = e.getCause().toString();

Log.i("TCP",response);
}

return socket;
}

protected void onPostExecute(Socket result) {
socket = result;

}
[Java for Android App Development] warlock9_0:
yes, you can pass the socket like you do

but in the onsensorchanged function you are using the printwriter (pw) you created in the doinbackground function which is null because you haven't passed it to the main thread

so, you either have to make a new object that will pass all the things to the main threat (socket, printwriter, bufferedreader) if you want them all, or pass the printwriter only, or you will initialize them on the post execute function

for example, you can return the socket and then do

protected void onPostExecute(Socket result) {
socket = result;
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
pw = new PrintWriter(socket.getOutputStream(),true);

}
[Java for Android App Development] flavglen:
null

async task not completed because of socket not closed?
[Java for Android App Development] flavglen:
Thank u

bro..some how i managed to get it work..thanks a lot for ur time..and nice to meet u..
[Nexus 5 Accessories] pingvin69:
Trident Aiges

http://www.youtube.com/watch?v=2kBjFaYD47U

Really like the dust filters!

but the case is a magnet for dust

Ballistic SG Shell vs Maxx SG

http://www.youtube.com/watch?v=qmH69aKPZD8

Very good protection, but like the trident the case catches some dust if you put it into the pocket or something....
[Nexus 5 Accessories] Bleys43:
I don't know about the Trident, but on the ballistic, the silicone becomes more smooth with use, and no longer attracts dust so much.
[Nexus 5 Accessories] pingvin69:
Yes you are right, with use the case becomes more smooth and nice to work with....
[Android Q&A, Help & Troubleshooting] depakjan:
Is there any xposed module to change the menu backgrounds / the slider colors?

View attachment 2563817

This blue background and the blue slider?

And these backgrounds

View attachment 2563818

I know many themes change these backgrounds, but i was wondering if a xposed module out there which can do this
[Android Q&A, Help & Troubleshooting] Nasheich Xfiles:
you can check on the Module Collection thread, maybe you'll find what you want there
[Android Q&A, Help & Troubleshooting] depakjan:
i did search there.. don't think such a mod exist yet.
[Android Q&A, Help & Troubleshooting] GermainZ:
XBlastTools can do that.
[Android Q&A, Help & Troubleshooting] depakjan:
if you are talking about the 'holo theme' in visual tweaks , i tried that, nothing changed.
[Android Q&A, Help & Troubleshooting] GermainZ:
Nothing at all? Did you reboot?
[Android Q&A, Help & Troubleshooting] depakjan:
Yea i did reboot, only the font color changed. nothing else.
[Android Q&A, Help & Troubleshooting] toknitup420:
Are you on a tw device. Xblast is not compatible with touch wiz devices.
[Android Q&A, Help & Troubleshooting] es0tericcha0s:
It is a Samsung device. You can tell specifically from the menu theme itself. ;)

Edit: This would be the module that should be able to change to the holo theme for you:

http://repo.xposed.info/module/ma.wanam.xposed

But could depend on which update you are on as well.
[Android Q&A, Help & Troubleshooting] toknitup420:
Honestly didn't even check the pictures lol.
[Upgrading, Modifying and Unlocking] androidify:
Carliv Touch Recovery v2.2

MTK CWM-based v6.0.4.4

This is a CWM based Recovery with touch screen support and Aroma File Manager capability.

Developed by carliv fronm xda with Clockworkmod v6.0.4.4 base.

With full touch support module developed by Napstar-xda from UtterChaos Team, all adapted and improved by carliv [MENTION=243864]xda[/MENTION].

For Aroma File Manager is recommended version 1.80 - Calung. from amarullz xda thread, because it has a full touch support in most of devices.

For full touch control, tap on desired menu button.

For Go back swipe to the left.

For scroll up and scroll down in long menu pages, Swipe to Right for page down, and swipe top left for Page up. and on top of the menu Swipe Left for Go back.

ported by me

NOT JUST DOWNLOAD IT PRESS THE THANKS BUTTON!

Download Link:

download here

Aroma File Manager inside Carliv Recovery:

download here:

http://www.mediafire.com/download/dralzxpy4kbb3dc/AROMA.zip

How to:
[Upgrading, Modifying and Unlocking] androidify:
press thanks for those who used it...
[Galaxy S III Q&A, Help & Troubleshooting] Supernova 21:
Hello guys,

A month ago i installed PACMAN ROM 4.3(cyanogen mod 10.2 , aokp version i9300_jb-mr2 , paranoidandroid version 3.99 RC2) nightly build in my SGS3.I searched in many forums not only in XDA, i tried many kernels like googymax, boeffla kernel, adams kernel but these didnt worked because every time when i boot my device it ends up with bootloop. Can you suggest me some kernels for my device cause i want to stabilize my ROM increasing the voltage in my cpu?

If you have any other good idea to stabilize my ROM tell me please because it lags a lot and i cant install a new ROM because the IMEI changes every time and the only way to use my phone as a phone is to restore my PACMAN ROM backup. Well you can see that i havent many problems so*please help me...

Thanks!
[Galaxy S III Q&A, Help & Troubleshooting] Andr3y29:
AGNi

Have you tried AGNi kernel: http://xdaforums.com/showthread.php?t=2231393 ? That's the kernel for custom ROMs (as PAC-MAN is based on CM, I guess it will work). That's the kernel I always use on any ROM I install (Now using the stock version + SmartDroid Lite v5). I trully recomend it, especially if you want a stable ROM and to tweak A LOT at it. You can Overclock or undervolt both CPU and GPU (individual settings). It will automatically install it's app when you flash the kernel. I reccomend you try it out and play around with it few days to see how it is. Good luck ! ;)
[Galaxy S III Q&A, Help & Troubleshooting] boomboomer:
Your identical post on the same subject was locked, why post another?
[Galaxy S III Q&A, Help & Troubleshooting] Supernova 21:
Well the kernel promises a lot but i cant download it because it goes at mega.co.nz and this site doesnt show any files just his homepage which says to download the apk
[Galaxy S III Q&A, Help & Troubleshooting] Andr3y29:
Download the app from PlayStore. Open the link again and it will work.
[Galaxy S III Q&A, Help & Troubleshooting] Supernova 21:
I installed the apk but when i open to download the kernel says that file folders are not supported
[Galaxy S III Q&A, Help & Troubleshooting] Andr3y29:
Sorry. Looked again at the forum and if you have Web view or you are on PC you can look at the top of first post. There it is a Download section with Direct Download or Torrent Download . You don't need Mega.
[Galaxy S III Q&A, Help & Troubleshooting] Supernova 21:
Ok, dont worry, i found the downloads but all kernels are for cm 11 and i am running cm 10.2
[Galaxy S III Q&A, Help & Troubleshooting] Andr3y29:
Look at the first post and see at what version the auppirt for 10.2 was dropped, and install the previous one. Or there it says "All roms" or something like that. Read the description and you will see the exact details.
[Galaxy S III Q&A, Help & Troubleshooting] malybru:
Mod Edit

Thread closed , as per previous reason.

malybru

Forum Moderator
[Xperia Z Q&A, Help & Troubleshooting] marcviado:
I'm new to the xperia z and want to know how to go about rooting and flashing roms for this phone.I understand the bootloader is locked..what are the rom's available for the tmobile/u.s variant of the phone?
[Xperia Z Q&A, Help & Troubleshooting] Dhickory:
As long as the ROM is based off of stock Sony firmware you are good. Look for the "LB" (lockedbootloader) tag withing the ROM title, and you should also see instructions if you have a LB.
[Xperia Z Q&A, Help & Troubleshooting] marcviado:
Thankyou..how about rooting? Again I have a tmobile C6606 on 10.3.1.E.0.191 I saw couple root methods but not sure if my device is supported. I've been seeing lots of I bricked my device thread so just trying to be cautious
[Xperia Z Q&A, Help & Troubleshooting] Dhickory:
I can't remember what t-mobile firmware I was on (6 months ago) when I rooted, but I know I used a [MENTION=2784807]DooMLoRD[/MENTION] method...I think this one (http://xdaforums.com/showthread.php?t=2386405)

You can always use flashtool to install a generic .67 FTF, then root and install recovery. This is the safest way to go, but you will lose t-mobile specific functions like wifi calling, but also t-mobile bloat. If you are looking to install a custom stock ROM then you will be losing these functions anyways.

Just make sure you get the latest flashtool and drivers - http://xdaforums.com/showthread.php?t=2635830.

EDIT: Actually I believe I used this method (http://xdaforums.com/showthread.php?t=2327472) to root as I was on the .166 firmware. The method above is what you want as .67 is what you'll need if making the jump to 4.3.
[Verizon HTC One (M7)] carm01:
Getting:

assert failed: package_extract_dir("system", "/system") when trying to take the 4.4.2 ota.zip

am kinda of at a loss

see attached

STOCK everything.

spent hours on this
[Verizon HTC One (M7)] Damonwang:
i also got the same error!!!!
[Verizon HTC One (M7)] SynisterWolf:
stock OTA or did you download it here?
[Verizon HTC One (M7)] carm01:
This was the actual OTA back then, i even tried using stock recovery as shown in the picture in the OP. I usually just take everything back to stock, take the OTA, flash recovery, root, debloat, apply my mods and bada bing.

This last one was a nightmare and i waited til santod had a rooted odex stock for it this time.

Sense 6 should be coming in about 30 days so im wondering if it will be as painful
[Verizon HTC One (M7)] SynisterWolf:
TBH if you have root, there is no need to take the stock OTA. santod does a great job offering the firmware as a zip and then release a stock rom flashable. its equal to taking the OTA without having to get back to stock. it might take a few more steps than an OTA would but its a lot easier.

flash full firmware zip (minus the boot.img)

flash recovery of choice

flash stock rom he offers or any rom re based with the OTA files.

done

it does take a little bit more because you'll need to use a computer and fastboot but you already need this to go back to stock.

but anyways, i have never seen stock recovery not flash an OTA correctly like you've shown above. sorry to hear you're having trouble with it.
[Verizon HTC One (M7)] carm01:
Yea i know he does a super job, unfortunately im not as good, would like to know how to make a stock rom out of the ota ans properly zip it up. not sure how to pull it from the phone.

I like to take it b/c i like to be the first to post my mods for the ota and get them done.

I also like to understand more. I know there are a zillion things out there, but some aint the best as they do not fully explain everything step by step, they skip stuff and make assumptions on your knowledge.

anyways ima shut up now lolz.

Ill prob wait, but i hate waiting.
[Verizon HTC One (M7)] cmlusco:
A basic rom consists of a adb pull of the /system partition, a pull of the boot.img, and a meta folder which contains install files and scripts.

Do some googling, i have seen more than one thread and youtube video showing the basicics of making a rom. And thats just the basics, a true rom is built from source which is a whole nother ball game. Its not something that can be learned quickly, but more with a lot of study and trial and error.
[Galaxy S III General] vantt1:
This is a good video on how these screens can be separated and replaced with a perfect bubble-free and dust-free finish:

[YOUTUBE]/watch?v=ndgBUhYIhaM[/YOUTUBE]
[Galaxy S III General] AdamOutler:
Most of the time its a better idea to just buy an entire replacement. I've replaced glass on nexus 7's and Galaxy Note2's a few times. it's not fun to replace glass or lamination, and it's just a whole lot easier to purchase a "parts" phone with a working display from ebay and swap out boards. Glass is one of my least favorite things to play with.
[Galaxy S III General] DiamondBond:
Awesome dude! thanks alot for the tutorial, but i dont think people have industrial size vacuums in their house, lol, ;)
[Galaxy S III General] bradipovsky:
Thank you so much, this is very helpful!

Can I ask how you got the information? That would be very useful to do further research about other devices :)

Thanks again!
[Galaxy S III General] HankChill:
I will never, ever separate the glass and the screen. I know that it will break for sure. When I replace phone glass, I replace the entire front screen assembly which includes the glass, screen, and any frame to attach it into the phone. Even if it's just the glass that's broken and the LCD still works, still replace the entire front assembly.
[Galaxy S III General] pelago:
I think the point is that unless you have all this stuff you shouldn't be even attempting to replace the glass.
[Galaxy S III General] Ricky Divjakovski:
i have tried this multiple times and all i can say is for anyone at home wihtout the professional equipment your not gonna get anywhere.. this isnt like and iPhone 3G/S where you take the screen off and seperate the LCD from the digitizer with a heatgun or hairdryer, ive tried all possible ways an failed every single time, either broken AMOLED or in some cases half the AMOLED comes off with the adheasive...

just save your money and buy the digitizer with the AMOLED attached..
[Galaxy S III General] andr3wchong:
but what will you do with the old screen with the broken front glass ?
[Galaxy S III General] HankChill:
Chuck it :)
[Galaxy S III General] matmaneyre:
I have replaced many screens, and in my experience, you're always best buying everything as readily assembled as possible. Out of 5 attempts at separating the S3 Glass from the AMOLED panel, I have managed it twice without breaking the AMOLED, and that involves also keeping the digitser intact as well, which is between the outer glass and the AMOLED.

Back when I was doing this, you were looking at £175+ for the complete assembly, so to some people, £20 at a risk was worth it if I could manage it. Now though they're cheap enough to replace the whole lot without the worry.

There is an app on Play Store called ifixit which gives pretty detailed step-by-step instructions for most DIY teardowns and fixes for phones, tablets, consoles and even some household applicances, and they have a website too. Unfortunately, it's only experience (and expense) that make you realise that just because they make it look doable, it doesn't mean everyone can do it easily. There are many, many pitfalls that you will only discover yourself when you take on these DIY repairs, to the point where I don't do them all that often anymore, just because it's too stressful and costly if it goes wrong. My first iPhone 4 (am I allowed to say that here? :) ) screen replacement took me 3 hours just because of how careful I was. Now I can do it in 20 minutes, just because of experience. But even then you can be plagued with problems for no apparent reason. If you don't handle stress well, my best advice is to leave it to the experts :D
[Galaxy S III General] Ricky Divjakovski:
you musty be really good :P out of i think 7 possible 8, i have managed to seperate once, but still i scratched the AMOLED...
[Galaxy S III General] matmaneyre:
It never feels like I'm very good when I see the screen go though. Just that sick feeling :/

Saying that as well, I gave the phones back to whoever they belonged to when they were done. There's nothing to say that a couple of weeks/months down the line they faced the problems of dust under the glass, touchscreen sensitivity reduced etc. They were just happy to get them back 'looking' perfect.

Never again
[Galaxy S III General] Ricky Divjakovski:
your right, quallity also plays a BIG part aswell, like you said never know what could happen, but better brands generally have better touch respones and just generally more smoothe, i knew someone who had just got the digitizer replaced by a phone repair shop, they couldnt use their phone in the wind thats how bad the replacement was..

EDIT: response**
[Galaxy S III General] vahid8910:
thank you, says my sii p :D

you saved a sii today, i'm using my phone without screen protection so it gets scratches after long times and i said to myself that's ok, i will replace the gorilla glass. that would be open the phone replace it then close it and i will have a new sii p again :D but sounds it's not that easy.
[Galaxy S III General] paul_59:
Very interesting thread.

I must be lucky,as on several occasions with most phones I have owned (HTC Desire hd, HTC One X, HTC One,Nexus 5, Samsung Note 3) I have accidentally dropped my phone. I've never had a case on and have on some occasions been unlucky to have the phone land on the screen, it has happened indoors and outdoors, on concrete and tarmac, despite this I haven't ever broken the glass.
[Galaxy S III General] MobileEMT:
I wouldn't follow the advice to "Chuck it". We purchase these cracked glass assemblies as long as the touch screen and LCD still work fine. We can pay up to $100 PER screen, depending on the model. PM us for prices for bulk orders.
[Galaxy S III General] TichDarkener:
I very recently bought myself an used Galaxy S3 and to my great disappointment the glass has no scratches because it has been replaced. Now I got ****ty touchscreen response and already dust is gathering between the digitizer and the glass. I might try to sell it off and buy myself another one, this time checking very carefully that everything is in perfect working condition!

So much for thinking I had found a bargain for this fantastic phone (which, despite the problems, is a nice upgrade from my Galaxy Ace!) :(
[Galaxy S III General] Ricky Divjakovski:
Really? I have a crapload
[Galaxy S III General] MobileEMT:
Good to hear! We'll PM you. Feel free to contact us if you would like to sell or refurbish them.
[Galaxy S III General] Drakenfall:
Well, i wish i read this thread before i bought the glass for my S3. My glass broke and i saw many DY and thought, well i can do this, but now, well, I'm not shure i will try it.
[Galaxy S III General] rebel1699:
I broke the lcd on my i727, and more recently, my i337. In both instances, I opted to buy the entire front assembly in the frame. Simply switch the board and a few other parts. It costs more, but best for the basic "screwdriver jockey". Besides, who wants to order a part, wait for it, then fail and have to order and wait again? Odds are, thats how it will go. Just go pre-assembled and save yourself time and aggravation.