Friday, May 3, 2013

[General] iOS to Android - things I miss


Switched over from an iPhone to my Note II not too long ago and am really enjoying it but there are a couple things about iOS that I'm starting to wish android had as well. The first being better music capabilities. A quick double tap of the home button with the iphone brought up a simple player that tied in beautifully with the lockscreen (or multitask bar if your phone wasn't locked.) I can't seem to find anything for android that does this. There's also a jailbreak tweak for the iphone called Activator which basically let's you assign functions to anything. For example, I had the volume up button set to change tracks when long pressed. It was really handy when driving rather than having to take my eyes off the road and fumble with the phone to change tracks.

Thing number two: volume control. The volume buttons on the iphone control everything whereas the volume buttons on my phone control only the ringtone. I would like for all sounds to be linked together.

Anybody know of any root or non root apps that can do what I've mentioned? Thanks guys.



.

forum.xda-developers.com

[General] Can't activate Boost ZTE Warp Sequent!?!


I purchased a used Boost Mobile ZTE Warp

Sequent from a reputable seller on Ebay. Boost

tells me they can't activate it, the MEID isn't in

their system. This IS a Boost phone. It boots up

with the Boost logo, says Boost Mobile beneath

the signal strength indicator (which shows it

receiving a signal AND 3G). It has Call Balance,

Call Reboost, and Care Services in the

contacts, everything in the phone is set up for

Boost. Is Boost bending me over with no

reacharound because they want me to buy a

phone from them? I've been a Boost customer

for over 5 years. Is this how they reward loyalty?



.

forum.xda-developers.com

[General] Samsung Galaxy S - All Messages Randomly Delete


I went to send a text message today, and all of my conversations had been cleared. This has happened once before about a year ago and I eventually gave up trying to restore my messages. Has anyone ever heard of this happening/know how to prevent it? I'm thinking the message database is somehow getting corrupted which is why it's clearing out all of my conversations?

Please let me know if you have any suggestions!

I'm running 2.3.3 - my phone was rooted at some point but I'm guessing after an OS update I lost that capability. This happened before the OS update and now after.



.

forum.xda-developers.com

[android help] How to handle empty ListView in android?


Having a bit of trouble dealing with empty ListView in android. Here's what I've got:



public class MainActivity extends ListActivity {
...
refreshList();
...}


public void refreshAlbumList(){
albumList=control.listAlbums();

if (albumList.length!=0){
ArrayAdapter ap = new ArrayAdapter(this,android.R.layout.simple_list_item_1,albumList);
setListAdapter(ap);
}else{
//deal with empty list somehow, currently results in error
}
}


What I've tried is:



this.getListView().setEmptyView(findViewById(android.R.id.empty));


And then inserting a TextView with id empty into main_activity.xml But the result was that took over the screen and I couldn't see the list.


Current xml:



xmlns:tools="http://schemas.android.com/tools"
xmlns:android1="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".MainActivity" >

android1:id="@id/android:list"
android1:layout_width="match_parent"
android1:layout_height="wrap_content"
android1:layout_weight="1" >





.

stackoverflow.comm

[android help] Android webview cache force loading


This might be a very trivial question with android webviews, but I am not getting good and clear material online to understand the concept. I am trying to build a webview android app that connects to a server initailly, downloads the HTML/JS/CSS data to local cache (getCacheDir) and serves the content from there. Any server call from the webview goes out to the server and results are returned and interpretted. But the assets are loaded from the local webview cache. The next time app is launched, there is some logic that checks if the version of the downloadable assets have changed, and in that case new package is downloded and replaced in the cache. If ther is no change, the content is served from the cache.


Now what I have the following questions: is the webview cache same as application cache (set vai getCacheDir() ) as in webview we do



webview.getSettings.setAppCachePath(getCacheDir().getAbsolutePath(+"/cache");


can i force the webview to load from cache VS network (using LOAD_CACHE_ELSE_NETWORK and LOAD_DEFAULT)


I am a bit confused. Please clarify these concepts?



.

stackoverflow.comm

[android help] Wat is the best way to refresh a android's listview


I want to refresh the listView after an insert or delete in the database.. I search and i found notifyDataSetChanged () but i don't know how to use it..


I used AsyncTask to get the data from the server and insert it into the SQLite database. The problem is, the AsyncTask class is in a another file. So how can i access the adapter or the listview from the AsyncTask class?


Someone can explain how to do this? Even by a different way..


Here is my code...



public class devicesController extends SherlockFragment {

devicesDataSource deviceDS;
static devicesAdapter adapter;
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = inflater.inflate(R.layout.devices, container, false);

/// Set device's datasource
deviceDS = new devicesDataSource(getActivity());

/// Assign the listview from the xml layout
ListView lv1 = (ListView) view.findViewById(R.id.devicesList);

/// Getting all devices from the SQLite database
deviceDS.open();
List allDevices = null;
try {
allDevices = deviceDS.getAll();
} catch (ParseException e) {
e.printStackTrace();
Log.i("QUTAYBA", "ERROR showing data");
}


/// Set the results rows in a list adapter
adapter = new devicesAdapter(getActivity(), R.layout.devices_list, allDevices);
lv1.setAdapter(adapter);

return view;

}


.

stackoverflow.comm

[android help] Android Programming: Looping Voice Recognition


I'm looking to make a custom Android app to help out a physically disabled person. I need to heavily rely on voice recognition. The idea would be:


  1. the app (via voice recognition) accepts his speech

  2. the app parses his speech and executes his commands ("email dad", "text fred", "what time is it?", etc, plus other things I'll be adding to control his tv, lights, etc)

  3. after execution, the app waits for his next command (loop back to #1)

I have #1 & #2 working fine, but I can't figure out a good method for #3. I can't leave Google's voice recognition view running indefinitely because it could be hours before the next command. But the 'trigger' does have to be based on sound/voice. Has to be completely hands free.


Ideally, the app would just listen for a sound, and if that sound is above a certain pre-programmed decibel level, I'd start voice recognition. Is it possible to constantly loop just listening for a noise, then react if it's 'so' loud?


Any ideas?


Thanks



.

stackoverflow.comm

[android help] How to get crypto scheme UUID



MediaCrypto class can be used in conjunction with MediaCodec to decode encrypted media data. Crypto schemes are assigned 16 byte UUIDs, the method isCryptoSchemeSupported(UUID) can be used to query if a given scheme is supported on the device. http://developer.android.com/reference/android/media/MediaCrypto.html



But what is crypto scheme UUID and where can I get it? Seems like I've missed it.


Thanks in advance :)



.

stackoverflow.comm

[android help] Supporting Multiple Screens for hundreds of icons

android - Supporting Multiple Screens for hundreds of icons - 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.

















In my application I have to use hundreds of bitmap icons and we want to support multiple screen.


And through the documents at android developer, it seems that it is the only way to create these icons for different devices with different dpi.


If this is true, we will have a hard work, so I want to know if there is an alternative to avoid this?
















Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.










default






.

stackoverflow.comm

[android help] Call to Asynchronous Function


I am using parse.com as my backend service for my Android application. I wish to make separation between my activities and parse, for this purpose I have created service class witch will bridge activities and parse (backend). Most parse functions are asynchronous and I don't really know how to handle them. For example if I want to login with a user I will call the service object that should execute login with parse login function. So here is my code in the activity:



LoginService login = new LoginService("username", "password");
login.login();
//from here it is not correct
if(login.getLoginStatus() == 2) {
//user loggedin
}...


and my service code is:



public LoginSrvice(String userName, String pass)
{
this.userName = userName;
this.pass = pass;
}

public void loginUser()
{
ParseUser.logInInBackground(userName, pass, new LogInCallback()
{

@Override
public void done(ParseUser user, ParseException e) {
if (user != null) {
logedIn = 1;
} else {
logedIn = 2;
}
}
});
}

public int getLoginStatus()
{
return logedIn;
}


My question is how should I do it right? how can i keep both activities and services separated but still wait for the response in the activity till the service class will get the callback from parse. Thanks for the HELP in advance!



.

stackoverflow.comm

[android help] can not open files with openFileInput saved via openFileOutput



Thread thread = new Thread() {

@Override
public void run() {
try {
saveDataFromWeb();// here i write data into a file
} catch (Throwable e) {
AlertDialog.Builder builder = new AlertDialog.Builder(
findViewById(R.id.viewpager).getContext());
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
sw.toString();
builder.setMessage(sw.toString());
AlertDialog alert = builder.create();
alert.show();
}
}
};
if (CONDITION) {
thread.start();
parseData("ThisWeekDatabase"); // here I read the data from the
parseData("NextWeekDatabase");
}


I found the error. It is because the thread is not done with it's work (writing data from the web into files) when I try to read these files. Now I need a way to "wait" for the thread so it has finished writing the files when parseData(xyz) needs them.


also either the way I write the data into the file or the way I read the data from the files is wrong because I get one single long line when I read out of the files I have written in before instead of multiple short lines.


I get



div.lvsdrt {background-color:#e3f1ff; border-top:black 1px dotted;padding:0.1em;}div.lvwer{background-color:#f2f9ff;border-top:black 1px dotted;padding:0.1em;}div.nobreak {page-break-inside:avoid;}


instad of



div.lvsdrt {
background-color:#e3f1ff;
border-top:black 1px dotted;
padding:0.1em;
}
div.lvwer {
background-color:#f2f9ff;
border-top:black 1px dotted;
padding:0.1em;
}
div.nobreak {
page-break-inside:avoid;
}


.

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...