Wednesday, May 8, 2013

[General] Numbers Entered Into Contacts on LG L9 Doesn't Sync To Gmail Contacts Online :(


Welcome to AC Forums! Sorry you're having problems navigating the site--I suggest you give that feedback to one of the Moderators, because they're always trying to improve the site.

When adding contacts to your phone, you always have to be conscious of whether you're adding it to your Google account or to the phone's account. The Google account will sync with your Gmail Contacts in the cloud, while the phone account can't (the phone account is useful if you're importing contacts directly from Outlook). Different phone brands might have slightly different Contacts apps, but let me tell you how it works on my Motorola Droid Razr Maxx. When I add a contact using the People app (which is the stock contacts app), the entry screen has a prominent field at the top that says "Google contact" and my Gmail address. If I tap it, it gives me the option to change it Backup Assistant Plus, which is essentially the Phone account when you use a Verizon phone. You need to make sure that the field is set to Google in order for the contact to sync to the cloud. If you don't see that, try tapping the menu button in the Add Contact entry screen to see if it gives you the option there.

Unfortunately, once you've entered a contact into the Phone account, I don't think you can edit it to change to your Google account--you typically have to enter it again as a new contact, this time to your Google account.



.

forum.xda-developers.com

[General] Samsung Galaxy S4 SD Card Issue


Hi, i have same issue as well. I bought 64 gb micro sd sandisk memory card and since I start use I have.
Today I put sticky type on the card and I format the card from phone settings.

Now I'm watching whats going to happen.

Once when I had the problem I open back lid and sd card wasn't in the socket.



.

forum.xda-developers.com

[General] WidgetLocker Lockscreen and camera access


I recently downloaded the application Widgetlocker so I could modify my lockscreen. After installing the application and setting up my home screen, I noticed that whenever I quick access my camera from the lockscreen it prompts me for my password. With the stock lockscreen on my HTC One, it would normally just launch the camera without asking for my password.

Does anyone know if there is a setting in widgetlocker to allow this? I have searched the forums with no luck, so any help is appreciated.
Thanks.



.

forum.xda-developers.com

[General] Have device. Willing to root and have fun. HELP!


That's the Continuum, right? God I hated that thing, such a pain in the @$$ phone, with that Ticker getting in the way of everything!

The good news is you can root it pretty easily. The bad news is it was such a niche product that there's only a couple Roms and kernels for it, and they really don't do much. You can update the OS to 2.2, and I've read that 2.3 and even 4.0 is possible tho I haven't done it.

Xda has an extensive section for that phone, but not much has happened in 2 or 3 years.

Sent from my Nexus 4 using Android Central Forums



.

forum.xda-developers.com

[General] picture locations


Open your Camera app, tap the menu button and then the Settings icon (the gear icon). There should be a setting there to choose where to store pictures by default.

To move your pictures, you can use any file manager app (either the stock one or a 3rd party one like ES File Explorer) to move your pictures from internal storage (/storage/sdcard0/DCIM/Camera) to your external SD card (/storage/sdcard1/DCIM/Camera).

Moving files using these apps can be a little slow, so you might want to do it using your desktop/laptop. You need to plug it in via USB, make sure the connection settings are set to "USB Mass Storage" or "Disk Drive," then wait for the computer to register the two storage areas as separate drives. Then simply drag and drop like you would on your computer.



.

forum.xda-developers.com

[General] Best phone either smart or dumb for poor signal reception


Two things will affect your reception - antenna and spectrum. Smart phone vs. dumb phone doesn't matter.

Three companies consistently build phones with excellent antennas - Apple, Blackberry and Motorola.
Lower-end spectrum is better at penetrating obstacles, but doesn't travel as far. Higher-end spectrum travels further, but has problems penetrating obstacles.

The best solution for you will depend on who your carrier is and what phone you're using now.



.

forum.xda-developers.com

[android help] Loading large, scaled bitmap causes OOM (OutOfMemoryError) (Android)


I have now tried a thousand times to solve this on my own without any success whatsoever. I've logged and debugged the application and from the information that I've gathered there is this one large spritesheet that is used for an animation. It's a .png with the size of 3000x1614 pixels. There are 10x6 sprites in the spritesheet that is essential for the animation. There are no gaps in between the sprites whatsoever to make it as memory-efficient as possible.


This is my method in which I load, decode and resize my bitmaps into the aspect ratio of the user's phone vs. my phone which I am building the game upon:



public Pixmap newResizedPixmap(String fileName, PixmapFormat format, double Width, double Height) {
// TODO Auto-generated method stub
Config config = null;
if (format == PixmapFormat.RGB565)
config = Config.RGB_565;
else if (format == PixmapFormat.ARGB4444)
config = Config.ARGB_4444;
else
config = Config.ARGB_8888;

Options options = new Options();
options.inPreferredConfig = config;
options.inPurgeable=true;
options.inInputShareable=true;
options.inDither=false;

InputStream in = null;
Bitmap bitmap = null;
try {
//OPEN FILE INTO INPUTSTREAM
in = assets.open(fileName);
//DECODE INPUTSTREAM
bitmap = BitmapFactory.decodeStream(in, null, options);

if (bitmap == null)
throw new RuntimeException("Couldn't load bitmap from asset '"+fileName+"'");
} catch (IOException e) {
throw new RuntimeException("Couldn't load bitmap from asset '"+fileName+"'");
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
}
}
}

if (bitmap.getConfig() == Config.RGB_565)
format = PixmapFormat.RGB565;
else if (bitmap.getConfig() == Config.ARGB_4444)
format = PixmapFormat.ARGB4444;
else
format = PixmapFormat.ARGB8888;

//THIS IS WHERE THE OOM HAPPENS
return new AndroidPixmap(Bitmap.createScaledBitmap(bitmap, (int)(Width), (int)(Height), true), format);
}



This is the LogCat output of the error:



05-07 12:57:18.570: E/dalvikvm-heap(636): Out of memory on a 29736016-byte allocation.
05-07 12:57:18.570: I/dalvikvm(636): "Thread-89" prio=5 tid=18 RUNNABLE
05-07 12:57:18.580: I/dalvikvm(636): | group="main" sCount=0 dsCount=0 obj=0x414a3c78 self=0x2a1b1818
05-07 12:57:18.580: I/dalvikvm(636): | sysTid=669 nice=0 sched=0/0 cgrp=apps handle=705796960
05-07 12:57:18.590: I/dalvikvm(636): | schedstat=( 14462294890 67436634083 2735 ) utm=1335 stm=111 core=0
05-07 12:57:18.590: I/dalvikvm(636): at android.graphics.Bitmap.nativeCreate(Native Method)
05-07 12:57:18.590: I/dalvikvm(636): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
05-07 12:57:18.590: I/dalvikvm(636): at android.graphics.Bitmap.createBitmap(Bitmap.java:586)
05-07 12:57:18.590: I/dalvikvm(636): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:466)
05-07 12:57:18.590: I/dalvikvm(636): at com.NAME.framework.impl.AndroidGraphics.newResizedPixmap(AndroidGraphics.java:136)
05-07 12:57:18.590: I/dalvikvm(636): at com.NAME.GAME.GameScreen.(GameScreen.java:121)
05-07 12:57:18.600: I/dalvikvm(636): at com.NAME.GAME.CategoryScreen.update(CategoryScreen.java:169)
05-07 12:57:18.600: I/dalvikvm(636): at com.NAME.framework.impl.AndroidFastRenderView.run(AndroidFastRenderView.java:34)
05-07 12:57:18.600: I/dalvikvm(636): at java.lang.Thread.run(Thread.java:856)
05-07 12:57:18.620: I/Choreographer(636): Skipped 100 frames! The application may be doing too much work on its main thread.
05-07 12:57:18.670: W/dalvikvm(636): threadid=18: thread exiting with uncaught exception (group=0x40a13300)
05-07 12:57:18.720: E/AndroidRuntime(636): FATAL EXCEPTION: Thread-89
05-07 12:57:18.720: E/AndroidRuntime(636): java.lang.OutOfMemoryError
05-07 12:57:18.720: E/AndroidRuntime(636): at android.graphics.Bitmap.nativeCreate(Native Method)
05-07 12:57:18.720: E/AndroidRuntime(636): at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
05-07 12:57:18.720: E/AndroidRuntime(636): at android.graphics.Bitmap.createBitmap(Bitmap.java:586)
05-07 12:57:18.720: E/AndroidRuntime(636): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:466)
05-07 12:57:18.720: E/AndroidRuntime(636): at com.NAME.framework.impl.AndroidGraphics.newResizedPixmap(AndroidGraphics.java:136)
05-07 12:57:18.720: E/AndroidRuntime(636): at com.NAME.GAME.GameScreen.(GameScreen.java:121)
05-07 12:57:18.720: E/AndroidRuntime(636): at com.NAME.GAME.CategoryScreen.update(CategoryScreen.java:169)
05-07 12:57:18.720: E/AndroidRuntime(636): at com.NAME.framework.impl.AndroidFastRenderView.run(AndroidFastRenderView.java:34)
05-07 12:57:18.720: E/AndroidRuntime(636): at java.lang.Thread.run(Thread.java:856)
05-07 12:57:18.847: D/Activity:(636): Pausing...



This is the Memory leak report using the DDMS:



Problem Suspect 1


One instance of "com.NAME.framework.impl.AndroidPixmap" loaded by "dalvik.system.PathClassLoader @ 0x41a06f90" occupies 12 393 680 (54,30%) bytes. The memory is accumulated in one instance of "byte[]" loaded by "".


Keywords dalvik.system.PathClassLoader @ 0x41a06f90 com.NAME.framework.impl.AndroidPixmap byte[]


Details »


Problem Suspect 2


The class "android.content.res.Resources", loaded by "", occupies 4 133 808 (18,11%) bytes. The memory is accumulated in one instance of "java.lang.Object[]" loaded by "".


Keywords java.lang.Object[] android.content.res.Resources


Details »


Problem Suspect 3


8 instances of "android.graphics.Bitmap", loaded by "" occupy 2 696 680 (11,82%) bytes.


Biggest instances: •android.graphics.Bitmap @ 0x41462ba0 - 1 048 656 (4,59%) bytes. •android.graphics.Bitmap @ 0x41a08cf0 - 768 064 (3,37%) bytes. •android.graphics.Bitmap @ 0x41432990 - 635 872 (2,79%) bytes.


Keywords android.graphics.Bitmap


Details »




Additional Information: I use either RGB565 or ARGB4444 as the config for my images. I wish to use ARGB8888 for the images with gradients, but it just takes up too much memory. Another thing to note is that I do recycle my bitmaps when I do not need them anymore.


Another thing that seems to consume a lot of memory is my Assets class, which consists of all the "Pixmaps" that the game uses. The bitmaps loaded from the assets are stored in these "Pixmaps" and removed when not needed anymore (the bitmaps that is). Is there maybe a better way to store these objects? Please let me know:



public static Pixmap image1;
public static Pixmap image2;
public static Pixmap image3;
public static Pixmap image4;
public static Pixmap image5;
public static Pixmap image6;
public static Pixmap image7;
public static Pixmap image8;
public static Pixmap image9;
public static Pixmap image10;
public static Pixmap image11;
...


Another thing to note is that the OOM only happens on devices with higher resolutions than my own (800x480), which is because the bitmaps get scaled to make the app fit larger devices.


Also take note that the images are being drawn on a canvas, since what I am developing is a game and I'm not very experienced with OpenGL.



So, what should I do to solve this issue? How am I able to load lots of scaled bitmaps without getting the OOM while keeping their quality?



EDIT #1: JUST TO MAKE SURE YOU ARE AWARE OF WHAT MY ISSUE IS


I am getting OOM at the following line:



Bitmap.createScaledBitmap(bitmap, (int)(Width), (int)(Height), true)


I'm desperate for help! This is my final blockade from releasing this bloody game!



EDIT #2: NEW METHODS I'VE TRIED THAT DIDN't WORK


I tried adding the decoded bitmaps to a LruCache before using them. I also tried a method where it creates a map of the bitmap in a temp file and then loads it in again. Like this:



//Copy the byte to the file
//Assume source bitmap loaded using options.inPreferredConfig = Config.ARGB_8888;
FileChannel channel = randomAccessFile.getChannel();
MappedByteBuffer map = null;
try {
map = channel.map(MapMode.READ_WRITE, 0, width*height*4);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
bitmap.copyPixelsToBuffer(map);
//recycle the source bitmap, this will be no longer used.
bitmap.recycle();
//Create a new bitmap to load the bitmap again.
bitmap = Bitmap.createBitmap(width, height, config);
map.position(0);
//load it back from temporary
bitmap.copyPixelsFromBuffer(map);
//close the temporary file and channel , then delete that also
try {
channel.close();
randomAccessFile.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

((AndroidGame) activity).addBitmapToMemoryCache(""+fileName, Bitmap.createScaledBitmap(bitmap, (int)(Width), (int)(Height), true));

return new AndroidPixmap(((AndroidGame) activity).getBitmapFromMemCache(""+fileName), format);


.

stackoverflow.comm

[android help] Database insertion taking too much time- android sqlite


I am trying to insert around 2800 records into the sqlite database, it is taking 150 sec, which is way too much! Could anyone please tell how to optimize this insertion.



public void createVariantEntry(ArrayList> str) {
InsertHelper ih = new InsertHelper(Database, VARIANT_TABLE_NAME);
final int varid = ih.getColumnIndex(VARIANT_ID);
final int varmakeid = ih.getColumnIndex(VARIANT_MAKE_ID);
final int varmodid = ih.getColumnIndex(VARIANT_MODEL_ID);
final int varname = ih.getColumnIndex(VARIANT_NAME);
final int varposteddate = ih.getColumnIndex(VARIANT_POSTED_DATE);
for(int i=0;i<1253;i++)
{
ih.prepareForInsert();
ih.bind(varid, str.get(i).get(0));
ih.bind(varmakeid, str.get(i).get(1));
ih.bind(varmodid, str.get(i).get(2));
ih.bind(varname, str.get(i).get(3));
ih.bind(varposteddate, str.get(i).get(4));
ih.execute();
}
for(int i=1255;i {
ih.prepareForInsert();
ih.bind(varid, str.get(i).get(0));
ih.bind(varmakeid, str.get(i).get(1));
ih.bind(varmodid, str.get(i).get(2));
ih.bind(varname, str.get(i).get(3));
ih.bind(varposteddate, str.get(i).get(4));
ih.execute();
}
ih.close();
}


.

stackoverflow.comm

[android help] Setting up webserver to access media content for Android, Blackberry, and iPhone applications


first simply create VedioDownloader class and pass the url for download the vedio and call this class in thread in mainactivity



import android.os.Environment;
import android.util.Log;

public class VedioDownloader implements Runnable {
String vedio_URL = "http://daily3gp.com/vids/747.3gp";
//if download image then simply pass image url such as
//String image_URL = "http://www.appliconic.com/screen.jpg";
public void run() {
// TODO Auto-generated method stub
HttpURLConnection conn = null;
URL url = null;
try {
url = new URL(vedio_URLL);
} catch (MalformedURLException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
try {
conn = (HttpURLConnection) url.openConnection();
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
conn.setDoInput(true);

try {
conn.connect();
Log.d("Connection", "Connection Established");
InputStream input = conn.getInputStream();
File storagePath = Environment.getExternalStorageDirectory();
OutputStream output = new FileOutputStream(new File(storagePath,
"vedio.3gp"));
Log.d("1", "1");
byte[] buffer = new byte[input.available()];
int bytesRead = 0;
while ((bytesRead = input.read(buffer, 0, buffer.length)) >= 0) {
output.write(buffer, 0, bytesRead);
}
Log.d("2", "2");
output.close();
input.close();

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


}


mainactivity class



public class MainActivity extends Activity {


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("aftar thread","befor thread");
Thread objThread=new Thread(new VedioDownloader());
objThread.start();
Log.d("aftar thread","fater thread");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}


}



.

stackoverflow.comm

[android help] Emulator response is very slow

android - Emulator response is very slow - Stack Overflow







Tell me more ×

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

















Emulator in android is very slow and at times it is not responding as well. Does emulator performace is dependent on system configurations?


Is there any other way to view the android app output other than emulator? Kindly please suggest me as emulator is wasting most of my time.





























Yes, you can speed up the emulator by running the Atom x86 system images instead of the ARM ones (since those CPU instructions need to be translated and thus is slower). Read more here:


http://developer.android.com/tools/devices/emulator.html#accel-vm























The android emulator is slow, can't do much about it. However Intel HAX can speed up your emulator speed significanly. HAX must be installed from your android-sdk-direcotory/extrax/ Then setup your emulator to use the correct system-image. Take a look at intel-hardware-accelerated-execution-manager






















It is not a problem with your environment, it is just that the emulator is very slow.


Practically I use a real phone to do my tests. It is faster and tests are more realistic. But if you want to test your application on a lot of different Android versions and don't want to buy several phones, you will have to use the emulator from time to time.


The Android SDK now alows to use an x86-based Android emulator. See http://developer.android.com/tools/devices/emulator.html#accel-vm


Try Android x86. It's much faster than the Google Android emulator. Follow these steps:



  • Install VirtualBox.




  • Download the ISO file that you need.




  • Create a virtual machine as Linux 2.6/Other Linux, 512 Mb RAM, HD 2 GB. Network: PCnet-Fast III, attached to NAT. You can also use a bridged adapter, but you need a DHCP server in your environment.




  • Install Android x86 on the emulator, run it.




  • Press Alt+F1, type netcfg, remember the IP address, press Alt+F7.




  • Run cmd on your Windows XP system, change the directory to your Android tools directory, type adb connect .




  • Start Eclipse, open the ADT plugin, find the device, and enjoy!





















default






.

stackoverflow.comm

[android help] Android: making a simple layout


I would like to construct a simple table layout in Android BUT I got some problems with it. At part 1: there are some text views so I would like to put that TableRow's height to wrap_content. At part 2: same thing.


It works all still now BUT:


At part 3: there are 2 listview-s and at part 4 there are some buttons. I would like to do something like this: let the part 4's height to wrap content but make the part 3 to fill all the empty space on the screen.


a busy cat


Please give me a solution for this, beacause when i probed the part 3 filled out all the emty space till the bottom of the screen. Now I tryed with weight_sum BUT I do not like it because I would let the 4'd row to wrap_content.



xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:weightSum="1.0" >

android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:weightSum="1.0" >

android:id="@+id/phone_tab_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_right_border"
android:gravity="center"
android:singleLine="true"
android:text="Phone Tab"
android:textColor="@android:color/white"
android:textSize="14dp" />

android:id="@+id/pc_tab_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center"
android:singleLine="true"
android:text="PC Tab"
android:textColor="@android:color/white"
android:textSize="14dp" />


android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@layout/style_bottom_border" >

android:id="@+id/phone_path_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_bott_right_border"
android:gravity="center"
android:paddingBottom="5dp"
android:singleLine="true"
android:text="mnt/sdcard/Movies/dpad/sadas/asda/sda/as"
android:textColor="@android:color/white"
android:textSize="8dp" />

android:id="@+id/pc_path_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center"
android:paddingBottom="5dp"
android:singleLine="true"
android:text="mnt/sdcard/Movies/dpad/sadas/asda/sda/as"
android:textColor="@android:color/white"
android:textSize="8dp" />


android:id="@+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.9"
android:weightSum="1.0" >

android:id="@+id/listview_phone_files"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_right_border" />

android:id="@+id/listview_pc_files"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7" />


android:id="@+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.1"
android:background="@layout/style_top_border"
android:gravity="center"
android:weightSum="1.0" >

android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Button" />

android:id="@+id/button_active_tab_changer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:background="@android:color/transparent"
android:onClick="changeActiveTabButton"
android:src="@drawable/button_change_tab" />

android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Button" />



.

stackoverflow.comm

[android help] How to get data from JsonArray within Array using Javascript/JQuery?


I'm having the service response like,



{
"Name": [
[{
"Key": "A",
"Value": "Sample1"
}
],
[{
"Key": "A",
"Value": "Sample2"
}
],
[{
"Key": "A",
"Value": "Sample3"
}
],
[{
"Key": "A",
"Value": "Sample4"
}
]
],
"Title": "Office"
}


I need the output as Value field.


I tried lot of ways.But not getting any solutions. Please help me..



.

stackoverflow.comm

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...