Wednesday, April 10, 2013

[android help] Android: Obtaining a generated variable and its values?


I am making an app that encrypts plain text and then sends it via email. My cText variable that I have created in the 'encrypt' method (created from passT and keyT that user inputs) is returned at the end of the method. I am curious, however, as to how I am going to incorporate it in my onCreate method for including it's new encrypted contents into an email? Below is what I have however I am only getting errors:



public class ScreenNext extends Activity {

int key = 0;
static char ch;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_screen_next)

EditText emailT;//Import EditTexts (Key and Email)
Button send = (Button) findViewById(R.id.bSend);//Import button1 (Send)
final EditText passT = (EditText) findViewById(R.id.etTogg);//passT variable for Password Text for EditText field
final EditText keyT = (EditText) findViewById(R.id.etKey);
final EditText passT = (EditText) findViewById(R.id.etTogg);//passT variable for Password Text for EditText field

send.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
// TODO Auto-generated method stub
String keyText = keyT.getText().toString();
String passText = passT.getText().toString();
String EmailAdd = emailT.getText().toString();

//This must be fixed
//String cipherText = cText.getText().toString();


Intent email = new Intent(Intent.ACTION_SEND);//The intent
email.setType("plain/text");
email.putExtra(Intent.EXTRA_EMAIL, new String[]{EmailAdd.toString()});
email.putExtra(Intent.EXTRA_SUBJECT, "Your encrypted Password");//Subject is hard coded for convenience sake
email.putExtra(Intent.EXTRA_TEXT, cText.toString());//Here we add encrypted Password that has just been generated
startActivity(email);//Start the activity
}

});

}//End onCreate
...
}


And my encryption method:



public static String message(String choice, String subKey, String message) {
int Option = Integer.parseInt(choice);//Must pareseInt
int key = Integer.parseInt(subKey);
message = message.toLowerCase();


ScreenNext subcipher_1 = null;
String CipherTxt = subcipher_1.encrypt(message, key);
return CipherTxt;
}


public static String encrypt(String Txt, int key) {

//local var cipherText of type string is init empty
String CipherTxt = "";//May be able to remove this'un
String cText="";
//enhanced for loop
// start at 0, go until "as long as input text"
for (int i = 0; i < Txt.length(); i++) {
//get a char from the string at index i (start at 0 work through to end of string)
// and store in local var extractedChar for type char
char extractedChar = Txt.charAt(i);
/* enhanced for loop
* start at 0, go until end of user entered cipherKeyValue
* either set to lowercase a or add one to the char
* uses the checkifz method
*/
for (int j = 0; j < key; j++) {
ScreenNext subcipher_1 = null;
if (subcipher_1.checkIfZ(extractedChar) == true) {
extractedChar = 'a';
} else {
extractedChar++;
}
CipherTxt= new StringBuilder().append(extractedChar).toString();
}
//add extracted char to builder object
//change object builder to string and assing to cipherText of type String
//create new object builder from StringBuilder class
cText = cText.concat(CipherTxt);
}
//Pass the cipherText value out of the method to whom ever called it

return cText;
}


Any help is very much appreciated.



.

stackoverflow.comm

[General] Huawei U8160 Home button


Hi, Please help!!! The home button on my U8160 is not displaying the home screen anymore. It just vibrates but nothing else happens. Any solutions. besides I have also lost the lock screen page is not displayed anymore. How can I get it back?
Thanks



.

forum.xda-developers.com

[General] Downloading or streaming English films from other EU countries.


Hi, I just bought my nice shiny new Nexus 10 and perhaps naively thought that I could stream or download (legally) films in my own language when I'm in France or Holland or wherever, as I don't spend much time in the UK now. Seems to me that I can't, unless someone can gently shove me in the right direction. Google Play will only offer me the French versions when I'm in France (where I live now) and other sites like Lovefilm say the service is unavailable outside certain countries. Seems a bit daft to me when I can order and get posted a DVD with no problem and pick up satellite tv as well without anyone knocking at the door.
It also seems that iTunes will do this for me - I didn't go and buy the wrong device did I? Please someone tell me I didn't............
Any advice out there?



.

forum.xda-developers.com

[General] How to Backup SMS and photos from Stock Android


I've done a search, but I didn't find much.

I have a Galaxy Nexus, unrooted and with a locked bootloader. I want to root it, unlock it whatever and install some ROMs on it. I need to save all the texts and photos I've taken with it.

But most backup programs don't work without root/unlocked bootloader. I spent 6 hours trying to install Carbon App Sync to backup my files, but it doesn't offer me the option of saving to PC, which is what the free option is supposed to have. (I synced it with the Desktop program). I have the choice of saving to internal memory, which is great, except that the Gnex doesn't have a SD card (thanks for pushing us into using your cloud google) and so any backup I make will be wiped out when I root/unlock the bootloader.

It seems such a simple thing, but Android and all these apps have made it nearly impossible. I just want to get my texts and photos off this phone before I root it. How can I do this? Thanks.



.

forum.xda-developers.com

[General] Help with Rooting my tablet Please, sorry if a duplicate post or in the wrong spot


Ubuntu is alinux operating system, I use it because I like it better

: i dont know if the bootloader is locked or not, however this method on youtube does work to load a firmware onto the device

or you can search "q8 gs70b MIPS ATM 7013" and the process should ccome up however the one you find gives the wrong firmware, and the touchscreen stops working. I fixed that by reloading the firmware from the site however I am not understanding what the files at are for or how to use them. it is possible i9 did the process wrong i suppose, The firmware that my tablet uses is .

sorry if the typing is bad, I am currently using this lagtastic tablet to write this lol,

I have also tried Root_SuperSU, UnlockRoot, CF-Root-SGS2, Android_Root, Root_Transmission, SparkyRoot, instant-root.

I am hoping I missed something with the root files link on the video site, and also the bad firmware is also listed in a directory at the site with the correct firmware.

Thank you for you time.



.

forum.xda-developers.com

[General] Eeeer...how bad is this?


Hello. Alright, so, this enitre ordeal has been a bit of a nightmare for me and I need a bit of advice, please. :P This is going to be a bit of a long post so bear with me.

Being a college student I'd been looking at the Galaxy Note 10.1 for some time. So, I sold my Glaxy Note(phone). It sold for about what I expected but I was juuuuust about $100 short of affording a used Galaxy Note 10.1. I had found one with a shattered screen on ebay, guaranteed to have everything working. Even though the tablet seemed easy enough to fix, I was a bit leery about putting out my tablet budget on a broken one, as I was a bit unsure about opening it up and fooling around with it and I really didn't have the time. I mentioned it in passing to a friend one day and he told me his older brother was great with electronics and had fixed several before. All I had to do was get the tablet and a replacement screen and he'd fix it for me, free of charge. I trusted my friend and I'd hung out with his brother a few times and he seemed pretty competent to me. After averaging it out, I'd be able to get the tablet, a replacement screen and a keyboard case and come in under budget. So, I went for it. The tablet came in and worked perfectly. When the screen came in I sent them off with my friend. A week passes and my friend finally brings the tablet back.

The first thing I notice is that the screen is uneven in the frame. The bottom corners and some of the edges are raised slightly above it. The top wasn't even stuck to the frame and I could pull it back a bit. At this point my friend was uncomfortable and when I asked him what happened he told me that his brother had not only broken a few things inside but he hadn't known the screen had come with it's own adhesive already attached! He'd tried to glue the thing with hot glue and that's why it was raised slightly. Well, I was obviously kinda ticked but I'd given the guy permission to fiddle around inside of it. I figured I could chalk it up to a learning experience. Everything still worked fine, it functioned like it was supposed to and nothing acted weird. Still, there were a few specks of debris under the screen and the top part was so loose and separated from the frame so much that I was afraid of dirt and dust finding its way under the glass. So, I opened it myself.

My friend had told me he had broken one of the clips on the left speaker but that it still functioned and was held down on top. True enough, it is a touch loose on the bottom but it's nothing I would worry about. It doesn't move when jostled, so that was fine. The thing I'm worried about though, is he had evidently broken a chunk from the black plastic cover of one of the ribbon cables. It can still be clipped and there are still two sides protecting it. I'm pretty sure it has something to do with the function of the s-pen and it seemed to work just fine. I've just....never had this problem before. :P I have no idea how you would even break it unless your hand slipped or something. I replaced laptop/netbook components that used them and I've never ran into this. I've always figured they were there to protect the connectors on the cable from shorts or static or something. I've never really thought about it. So, it doesn't seem to be a problem now but could it potentially be? I do have a picture:

At this point just looking at the thing pisses me off and I'd thought of just trying to resale it on ebay and try and get some of my money back but I dunno. Slightly worried about saving up to afford a another used one, so I may just end up buying another replacement screen. :P



.

forum.xda-developers.com

[General] App to silence only email notifications when docked?


I'm looking for the above. I know there are apps to silence notifications based on location, and based on time of day but i want this and only this to occur: turn off email notifications when phone is docked (but leave all other notification on). Reason being, I'm already sat at my desk so dont need my phone dinging with new email as i can see i have new email from my pc's email client.

Any ideas?



.

forum.xda-developers.com

[android help] Android : Integerating Zbar in android app, The camera Preview for bar code scanner Freezes


I am using a customized bar code scanner app for my app and i am using the Zbar library,Using which i am encountering an issue. say, when i lock the device the area scanning freezes and when we unlock the device i am not able to scan further. Basically the problem is that the area allocated for scanning the barcode freezes on Locking the device.



.

stackoverflow.comm

[android help] Android Maps V2 Crashing


My big project for today was migrating my app to the new Google Maps API V2. However, I am hitting an error now that I can't seem to find the root cause of.


My stack trace looks like this:



12-17 17:16:20.366: E/AndroidRuntime(3634): FATAL EXCEPTION: main
12-17 17:16:20.366: E/AndroidRuntime(3634): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mobile.barwatch/com.mobile.barwatch.TestActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2088)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2113)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.access$700(ActivityThread.java:139)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1224)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Handler.dispatchMessage(Handler.java:99)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Looper.loop(Looper.java:137)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.main(ActivityThread.java:4918)
12-17 17:16:20.366: E/AndroidRuntime(3634): at java.lang.reflect.Method.invokeNative(Native Method)
12-17 17:16:20.366: E/AndroidRuntime(3634): at java.lang.reflect.Method.invoke(Method.java:511)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
12-17 17:16:20.366: E/AndroidRuntime(3634): at dalvik.system.NativeStart.main(Native Method)
12-17 17:16:20.366: E/AndroidRuntime(3634): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.setContentView(Activity.java:1901)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.mobile.barwatch.TestActivity.onCreate(TestActivity.java:18)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.performCreate(Activity.java:5048)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2052)
12-17 17:16:20.366: E/AndroidRuntime(3634): ... 11 more
12-17 17:16:20.366: E/AndroidRuntime(3634): Caused by: java.lang.RuntimeException: API key not found. Check that is in the element of AndroidManifest.xml
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.z.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.ae.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.bu.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at maps.y.p.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.internal.IMapFragmentDelegate$Stub.onTransact(IMapFragmentDelegate.java:107)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.os.Binder.transact(Binder.java:326)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.MapFragment$b.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d$4.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d.a(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.internal.d.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at com.google.android.gms.maps.MapFragment.onCreateView(Unknown Source)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:807)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1013)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1112)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.app.Activity.onCreateView(Activity.java:4704)
12-17 17:16:20.366: E/AndroidRuntime(3634): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-17 17:16:20.366: E/AndroidRuntime(3634): ... 20 more


My activity class looks like this:



package com.mobile.barwatch;

import android.app.Activity;
import android.os.Bundle;
import com.google.android.gcm.GCMRegistrar;
import com.google.android.gms.common.*;
import com.mobile.barwatch.tasks.*;
import com.mobile.barwatch.models.Constants;

public class TestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_screen);
}
}


My layout file looks like this:




android:id="@+id/mapview"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment"/>


And the relevant parts of my manifest look like this:



package="com.mobile.barwatch"
android:versionCode="1"
android:versionName="1.0" >

android:minSdkVersion="11"
android:targetSdkVersion="15" />
android:glEsVersion="0x00020000"
android:required="true"/>
android:protectionLevel="signature"/>
android:protectionLevel="signature" />











android:allowBackup="true"
android:icon="@drawable/ic_launcher_barwatch"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
....
android:label="@string/app_name">

android:value="xx"/>




Im really banging my head against the wall on this one so any help would be greatly appreciated.



.

stackoverflow.comm

[android help] Is it possible to get a notification when any location provider is enabled/disabled and ascertain what action occurred?


I wish to receive a notification when the user enables or disabled either Network or GPS locations, and importantly I wish to know which one they have changed and how. I have a broadcast receiver for the android.location.PROVIDERS_CHANGED broadcast intent and this is receiving the correct broadcast.


I now need to try and determine what action has occurred i.e. enable or disable and which provider has been changed. I know that I could keep the state of each provider and then when I receive notification that they have changed then I could work out what has changed, I am looking for a more "standard" method of doing this. The broadcast intent does not seem to have any extras to indicate which provider has changed.


This is the code I have currently.



public class LocationProviderChangedReceiver extends BroadcastReceiver {
private final static String TAG = "LocationProviderChangedReceiver";

@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().matches("android.location.PROVIDERS_CHANGED"))
{
Log.i(TAG,"Location Providers changed");
Bundle bundle = intent.getExtras();
if (bundle == null) {
Log.d(TAG, "No extras data");
} else {
Log.d(TAG, "Bundle received of size " + bundle.size);
}
}
}
}


And this is a small extract from my Manifest






android:name=".LocationProviderChangedReceiver"
android:exported="false">







Is anyone aware of any mechanism by which I can determine what state has changed without maintaining my own state variables.


In an ideal world I would monitor for changes constantly but only listen for location changes occasionally. I would like to avoid constantly monitoring for location changes.



.

stackoverflow.comm

[android help] Error while make android source


I use mac to build android 2.3 source,but I get error below:



192:build yixing$ source envsetup.sh
'bash: envsetup.sh: line 1: syntax error near unexpected token `{
'bash: envsetup.sh: line 1: `function hmm() {


can anyone help me ? Thanks!



.

stackoverflow.comm

[android help] android+Blackberry - How to create the simulator in the Eclipse


I am trying to integrate the blackberry plugin to android sdk in eclipse. I almost completed it but I struck at creation of the simulator in eclipse. I am confusing here. can anyone explain clearly.



.

stackoverflow.comm

[android help] On boot_completed notification not shown


I am creating an app which shows notification in future date. For showing notifications in future i have taken help of AlarmManager.


On button click in one of my activities i create notification like this



Intent myIntent = new Intent(getApplicationContext(),
BootService.class);
myIntent.putExtra("stuffid", stuffId);
PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(),
stuffId, myIntent, 0);

AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, day);

calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minute);
calendar.set(Calendar.SECOND, 00);

alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),pendingIntent);
// Tried set repeating also :(
// alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 30*1000, pendingIntent);


Here is my code for BootService class:



public class BootService extends Service {
DBController dbController = new DBController(this);

@Override
public void onCreate() {
super.onCreate();
}

@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {

LoadAlarmsFromDatabase();

int stuffId = intent.getIntExtra("stuffid", 0);
if(stuffId > 0)
new GetStuffDataAsync().execute(stuffId);

return super.onStartCommand(intent, flags, startId);
}

private void LoadAlarmsFromDatabase() {
DBController dbController = new DBController(this);
// Iterate over array and call addnotification no of time
...
addNotification(stuff.getStuffId(), calendar);
dbController.close();
}

private void addNotification(int stuffid, Calendar cal) {

Calendar rightNow = Calendar.getInstance();
long rightNowMillis = rightNow.getTimeInMillis();

// Add to alarm only when its greate than current date
if (cal.getTimeInMillis() > rightNowMillis) {
Log.v(TAG, "addNotification " + stuffid + ", " + cal);
Intent intent = new Intent(getApplicationContext(),
BootService.class);

intent.putExtra("stuffid", Integer.toString(stuffid));

PendingIntent mAlarmSender = PendingIntent.getBroadcast(
getApplicationContext(), stuffid, intent, PendingIntent.FLAG_UPDATE_CURRENT);

AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
//am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), mAlarmSender);
am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 30*1000, mAlarmSender);

}
}

public class GetStuffDataAsync extends AsyncTask {

@Override
protected Stuff doInBackground(Integer... params) {
int stuffId = params[0];
Stuff stuff = dbController.getStuffInfo(stuffId);
dbController.close();

return stuff;
}

@Override
protected void onPostExecute(Stuff result) {
Context ctx = getApplicationContext();

Intent notificationIntent = new Intent(ctx, AndroidAlarmService.class);
PendingIntent contentIntent = PendingIntent.getActivity(ctx,
1, notificationIntent,
PendingIntent.FLAG_CANCEL_CURRENT);

NotificationManager nm = (NotificationManager) ctx
.getSystemService(Context.NOTIFICATION_SERVICE);

NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);

builder.setContentIntent(contentIntent)
.setSmallIcon(R.drawable.ic_launcher)
.setTicker("Reminder: " + result.getName() + " expires on " + result.getExpiresOn())
.setWhen(System.currentTimeMillis())
.setAutoCancel(true)
.setContentTitle("NotifyWhenMyStuffExpires")
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentText(result.getName() + " expires on " + result.getExpiresOn());


Resources res = ctx.getResources();
if(result.getHasPhoto() == 1){
Bitmap bm = result.getPhoto();
builder.setContentIntent(contentIntent).setLargeIcon(bm);
}
else
builder.setContentIntent(contentIntent).setLargeIcon(BitmapFactory.decodeResource(res, R.drawable.ic_launcher));

Notification n = builder.build();

nm.notify(1, n);
}

}

}


On testing the application i see notification getting shown, problem is specific to booting the phone. In code above i am re-creating the notifications by calling LoadAlarmsFromDatabase


To handle recreating of alarms on boot i have used BroadcastReceiver


public class BootReceiver extends BroadcastReceiver {



private final String TAG = "BootService";

@Override
public void onReceive(Context context, Intent intent) {
android.os.Debug.waitForDebugger();

if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
android.os.Debug.waitForDebugger();

Intent mServiceIntent = new Intent(context,BootService.class);
mServiceIntent.setAction("com.whenmystuffexpires.BootService");
ComponentName service = context.startService(mServiceIntent);

if (null == service) {
// something really wrong here
Log.e(TAG, "Could not start BootService ");
Log.v(TAG, "BootReceiver - Could not start BootService ");
}



} else {
Log.e(TAG, "Received unexpected intent " + intent.toString());
Log.v(TAG, "Received unexpected intent " + intent.toString());
}
}
}


With debugger attached i see breakpoint getting hit and loadalarmfromdatabase getting called. But notifications are not getting shown.


Here is how my Reciever is declared in manifest



android:name=".BootService"
android:enabled="true" />

android:name=".BootReceiver"
android:enabled="true" >







Some more facts:



  1. On rebooting using ADB shell, notification DOES work!.


    $ am broadcast -a android.intent.action.BOOT_COMPLETED




  2. I am testing it on Gingerbread.




  3. Problem is only on reboot of phone.




.

stackoverflow.comm

[General] wi fi connection problem on my S3 after ypgrading to 4.1.2


Hi,
i just got my phone 3 days ago, when i bought it it was working properly and i had no problem with WiFi even with 4.1.2, but since yesterday it started refusing to join some wifi networks, even at my home, it was connecting normally then it doesn`t want to connect at all
what i noticed iis that i might need to downgrade my software to 4.1.1, so how can i do this safely, and is there any other option to solve this problem?
regards



.

forum.xda-developers.com

[android help] Streaming a song from a song downloading url


I have a link that directly starts downloading of the song, but I want to stream that song in my app without downloading. Is it possible? Please help me through.


Link is: http://workintelligentonline.com/church/audio/1New Stories (Highway Blues).wma



.

stackoverflow.comm

[android help] how to record .wav format file in android


After a quick google I found out that there is a direct support for wave recording. Most common wave format is PCM. The android.media.AudioRecord supports PCM output. You only need to write this to a file then.


After the file you then create you must program your own convertor to wave (or look for an online library for that).


If you like an app that is ready to go and record in wave you can download this app:


Extra link:



.

stackoverflow.comm

[android help] Android TableLayout Pagination Example Needed [closed]





I want a working demo of table pagination. Can some one give me link for table pagination. Android table pagination.

I tried this link, but it's not working. Can some one tell me how to achieve this. I tried PAGINATION LAYOUT

but this is not working. If this works can some tell the error in the program that I referred.












closed as not a real question by Tim Post Nov 28 '12 at 13:10


It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.














I would personally use either the ViewPager or View Flipper for pagination.

This video shows how to use the view flipper. ViewFlipper Example Just substitute your own view like TableRow.

If you want to use the ViewPager. Android documentation has sample code. (Edit: I should make note the viewPager requires the Support Library This will explain how to install it. Its very easy

Edit: This is pseudo how you xml layout will look like.



    
       
        

 
        

 
        
 













.
stackoverflow.comm

[android help] Android and SQLite, error in devices reading databases


I have a SQLite Database and I would like to use in my Android App.


First I copy my database from Assets to /data/data//databases/ using:



private void copyDBFromAsssetsToDataFolder()
{
try
{
String destPath = "/data/data/" + getPackageName() + "/databases/dbname.db";

File f = new File(destPath);
if(!f.exists())
{
Log.v("TAG","File Not Exist");
InputStream in = getAssets().open("dbname.db");
OutputStream out = new FileOutputStream(destPath);

byte[] buffer = new byte[1024];
int length;
while ((length = in.read(buffer)) > 0)
{
out.write(buffer, 0, length);
}
in.close();
out.close();
}

} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
Log.v("TAG","ioexeption");
e.printStackTrace();
}}


All my queries works fine in simulator but in the device I'm receiving:


Error opening directory: /data/data//databases/


Here, I'm reading people with the same problems and the solution is always assign permissions to this directory or copying the database to an external storage. But in production, the user does not have to have SD Card or you cant force to the user to assign permissions to the database (or other) directory.


What is the best solution to use databases already created?



.

stackoverflow.comm

[android help] JSON String to ListView not happening


I have a JSON String, I am trying to parse and then into ListView, my code does not throw any errors but it is not working either, I am unable to determine where I might be going wrong. Following is my code:



protected void onPostExecute(String result) {
super.onPostExecute(result);
str = result;
Toast.makeText(getApplicationContext(),""+str, Toast.LENGTH_LONG).show(); // Able to toast the JSON string (str) here.
mylist = new ArrayList>();
map = new HashMap();
try {
JSONArray jArray = new JSONArray(str);
for (int i = 0; i < jArray.length(); i++) {

JSONObject jObject = jArray.getJSONObject(i);


j_id = jObject.getString(ID);

j_make = jObject.getString(MAKE);

j_model = jObject.getString(MODEL);

j_version = jObject.getString(VERSION);
j_price = jObject.getString(PRICE);
j_reg_plc = jObject.getString(PLACE_REG);


Toast.makeText(getApplicationContext(),"After assign", Toast.LENGTH_LONG).show();



data = "Make: "+ j_make + "\nModel: " + j_model + "\nVersion: " + j_version + "\nPrice: " + j_price
+ "\nCity: " + j_reg_plc;



map.put("car", data);

mylist.add(map);

}
} catch (JSONException e) {
e.printStackTrace();
}




// list = (ListView) findViewById(R.id.listView1);
Toast.makeText(getApplicationContext(),""+mylist, Toast.LENGTH_LONG).show();
String[] from = new String[] { "car"};
int[] to = new int[] { R.id.text1 };
ListAdapter adapt = new SimpleAdapter(view_cars.this, mylist,R.layout.text_adaptr, from, to);

list.setAdapter(adapt);


}


It seems that my for loop is ubruptly exiting, It is not getting executed twice as the length of the array I am recieving from network is two. I have attached the screen shot of the JSON Array I am getting enter image description here


Please check the code for comments, for detailed information.



.

stackoverflow.comm

[android help] How do I set my Java SDK when creating an Android project in IntelliJ?

How do I set my Java SDK when creating an Android project in IntelliJ? - Stack Overflow




















I'm trying to get an Android project running in IntelliJ by following the JetBrain instructions here but run into an error message when trying to Select the Project Template (step #2). The error is


"Cannot Create SDK


You need to configure a Java SDK first".


I'm doing this on a mac and followed the first page of instructions before the ones linked above. In particular:


  • I ran the command "tools/android update sdk --no-ui" from the terminal after downloading only the Android SDK content. I mention this because it says to "run the SDK Manager", but I see nothing of the sort in what I've unpacked. Running the aforementioned command downloaded and installed many Android API versions and revisions.

  • The JDK I downloaded was jdk-7u17. I installed it; is that all I need to do?

The error for "configure a Java SDK first" comes up when I press the "New..." button in step 2. Does anyone know how I can configure my Java SDK? Is there something I missed or that is missing from the JetBrain instructions?


Clicking New... causes the error here.
















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










lang-java







.

stackoverflow.comm

[android help] How to restrict file size while writing to text file from an Android app

How to restrict file size while writing to text file from an Android app - Stack Overflow




















My Android App continiously writing logs in a .txt file. I want to restrict this file size.ie, if file size exceeds 1MB it will not write any more log and notification will be sent to the user that no more space in your log file.How can I implement that?





























try this code for calculating size:



File file = new File("text.txt");
long filesize = file.length();
long filesizeInKB = filesize / 1024;
long filesizeinMB=filesizeInKB/1024;



















default







.

stackoverflow.comm

[android help] Android - How to get rid of the bar above the ActionBar


My problem is there are another bar, not exactly sure what it's name is - TitleBar? (The bar with the menu button and the white square logo) Above my ActionBar. What I ideally want is to merge my ActionBar with that bar or if not possible, implement my own bar completely amongst the tabs with icon and menu button. I have tried several things (see below image)


Showing the unwanted standard bar above the ActionBar


I was under the impression getActionBar() got reference to the existing bar which sits above my ActionBar in the screenshot.. that would be ideal.


Current application theme is android:theme="@android:style/Theme.Holo.Light.DarkActionBar"


Anyway, I have tried the following:


  • Various manifest changes including various .NoTitleBar combinations

  • requestWindowFeature(Window.FEATURE_NO_TITLE); after super.onCreate() and before setContentView()

The reason I am using standard ActionBar is this for a hardware device that will be running at least 4.0 and the version is highly unlikely to change.


Any thoughts?


Cheers



.

stackoverflow.comm

[android help] How to end a launcher completely?


My application works as a launcher. But, I guess I did something wrong by making it a launcher. For instance, the user selects my application as Default Launcher (clicks 'Always'). However, when the user exits from the application, it appears again, because it's the default launcher. How can I fix it?



android:name="com.comeks.cocuktablet.Main"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait" >










The code comes from my manifest. I also want to make MAIN activity launcher.


Edit: I realized my exact error. I also wrote a code to start my app on boot. The problem is that when I close my device and open it again, I cannot exit from it.



.

stackoverflow.comm

[android help] CM10.1 no adb connections, phone shows offline


I'm using CM10.1 on a LG P990 Phone with Window 7 64Bit.


With CM10 I never had problems with the ADB connection to the phone but now the phone will be found but shows "offline".


I tried several ADB drivers, but everytime the same. I also tried to kill the ADB sever and started it again. At the moment I use as ADB Driver "Android ADB Device" from Google.


If I try to start DDMS I get this message:



09:24:17 E/DDMS: device offline
com.android.ddmlib.AdbCommandRejectedException: device offline
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:453)
at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:159)
at com.android.ddmuilib.SysinfoPanel.deviceSelected(SysinfoPanel.java:126)
at com.android.ddmuilib.SelectionDependentPanel.deviceSelected(Selection DependentPanel.java:52)
at com.android.ddms.UIThread.selectionChanged(UIThread.java:1756)
at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:772)
at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:760)
at com.android.ddmuilib.DevicePanel.access$1100(DevicePanel.java:56)
at com.android.ddmuilib.DevicePanel$1.widgetSelected(DevicePanel.java:368)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at com.android.ddms.UIThread.runUI(UIThread.java:535)
at com.android.ddms.Main.main(Main.java:117)


I hope you can help me to find a solution.


thanks Frank



.

stackoverflow.comm

[android help] Android Countdown timer one after other


I want start countdown timer one after other in android application.I am facing this problem I have written a code of second countdown timer's onFinish() method and it should start second timer.



.

stackoverflow.comm

[android help] display large text in libgdx


I have string array of quotes and want to display in libgdx. I am doing as follows



public int quoteIndexNo =2;
public String[] quotes = {
"Sometimes the heart sees what is " +
"invisible to the eye. H. Jackson " +
"Brown, Jr.",
"Being deeply loved by someone gives" +
" you strength, while loving someone " +
"deeply gives you courage. Lao Tzu",};
font.draw(batch, quotes[quoteIndexNo], 50, 100);


but problem is, being text large it is not properly showing in screen. how can I make sure that only 15 characters are visible in single line and rest part of string in another line.



.

stackoverflow.comm

[android help] Google Maps Android API v2: Failed to Load Map. Could not contact Google Servers


I'm trying to use Google Maps Android API v2, and I have already created the SHA1 key from my release cert.


I've read the comments from here and have made everything right, including the permissions for READ_GSERVICES which wasn't stated in Google's instructions here


However I'm still having the error of



E/Google Maps Android API(12334): Failed to load map. Could not contact Google servers.


Can anyhow enlighten me if I still have something left out?


I've included this as well:



android:name="com.example.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>



and



android:name="com.google.android.maps.v2.API_KEY"
android:value="my_api_key"/>


in my applcation tag.


UPDATE: Just Managed to remove that error, realied that I typed my READ_GSERVICES wrongly.


However, now I'm having this problem:



01-24 16:58:08.628: E/Google Maps Android API(28025): Authorization failure.


What is causing this problem? my SHA1 is obtained from my release cert, is that wrong?



.

stackoverflow.comm

[General] Huawei U8160 Home button


Hi, Please help!!! The home button on my U8160 is not displaying the home screen anymore. It just vibrates but nothing else happens. Any solutions. besides I have also lost the lock screen page is not displayed anymore. How can I get it back?
Thanks



.

forum.xda-developers.com

[android help] cant use AsyncTask in my activity


I have a problem with using AsyncTask..When I try to use AsyncTask I get error..But when I remove it every thing works fine..Can some one help me abut this?I also searched and find that I must add onpause() but It didnot work.Here is my code



package co.tosca.persianpoem;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.app.ProgressDialog;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;

public class Database_list extends Activity {

persian_poem_class main=new persian_poem_class(this);
public List selected_databases = new ArrayList();
public ProgressDialog pd;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_database_list);
File path=new File(ClubCP.SDcardPath+"/temp/database/");
Listfile_lists = main.directoryPath(path,false);
Log.i("file_list",file_lists.toString());
ListView Database_list=(ListView)findViewById(R.id.database_list);
final InteractiveArrayAdapter arrayadapter=new InteractiveArrayAdapter(this,file_lists);
Database_list.setAdapter(arrayadapter);
Button build =(Button)findViewById(R.id.btn_build_database);
build.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
selected_databases=arrayadapter.getSelectedItems();
if(selected_databases.isEmpty()!=true){
new bulid_database().execute();

}
else{
Toast.makeText(Database_list.this, "At least select one database", 1).show();
}
}
});
}
@Override
public void onPause()
{
super.onPause();
if(pd != null)
pd.dismiss();
}
private class bulid_database extends AsyncTask {

// Begin - can use UI thread here
protected void onPreExecute() {
pd = ProgressDialog.show(Database_list.this,"","Please wait...", true,false);
}
// this is the SLOW background thread taking care of heavy tasks
// cannot directly change UI
protected Void doInBackground(final String... args) {
// simulate here the slow activity
main.emptyDB();
main.creatDB(8);
for (int i =0; i < selected_databases.size(); i++) {


main.attachDatabase(selected_databases.get(i));
//publishProgress((long)i);
}
return null;
}
// periodic updates - it is OK to change UI
@Override
protected void onProgressUpdate(Long... value) {
pd.setMessage("still working");
}
// End - can use UI thread here
protected void onPostExecute(final Void unused) {
if (pd!=null) {
pd.dismiss();
}
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.database_list, menu);
return true;
}

}


and here Is error



04-10 09:39:15.467: W/dalvikvm(3411): threadid=12: thread exiting with uncaught exception (group=0x2b542210)
04-10 09:39:15.497: E/AndroidRuntime(3411): FATAL EXCEPTION: AsyncTask #1
04-10 09:39:15.497: E/AndroidRuntime(3411): java.lang.RuntimeException: An error occured while executing doInBackground()
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.os.AsyncTask$3.done(AsyncTask.java:278)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.lang.Thread.run(Thread.java:856)
04-10 09:39:15.497: E/AndroidRuntime(3411): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.os.Handler.(Handler.java:121)
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.widget.Toast$TN.(Toast.java:317)
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.widget.Toast.(Toast.java:91)
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.widget.Toast.makeText(Toast.java:233)
04-10 09:39:15.497: E/AndroidRuntime(3411): at co.tosca.persianpoem.persian_poem_class.creatDB(persian_poem_class.java:224)
04-10 09:39:15.497: E/AndroidRuntime(3411): at co.tosca.persianpoem.Database_list$bulid_database.doInBackground(Database_list.java:65)
04-10 09:39:15.497: E/AndroidRuntime(3411): at co.tosca.persianpoem.Database_list$bulid_database.doInBackground(Database_list.java:1)
04-10 09:39:15.497: E/AndroidRuntime(3411): at android.os.AsyncTask$2.call(AsyncTask.java:264)
04-10 09:39:15.497: E/AndroidRuntime(3411): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-10 09:39:15.497: E/AndroidRuntime(3411): ... 5 more


here is attach_database



public void attachDatabase(String database_name){
Log.i("attach_database",database_name);
//closeMyDb();
//openMyDb();
Db.close();
Db = SQLiteDatabase.openDatabase(ClubCP.DbPath, null, SQLiteDatabase.CREATE_IF_NECESSARY);
try{
String sql="attach '"+ClubCP.SDcardPath+"/temp/database/"+database_name+"' as toMerge; insert into cat select * from toMerge.cat; insert into poem select * from toMerge.poem; insert into verse select * from toMerge.verse; insert into poet select * from toMerge.poet;detach database toMerge;";
String[] queries = sql.split(";");

for(String query : queries){
Db.execSQL(query);
}
Db.close();
}
catch (Exception e)
{
Toast.makeText(c, e.getMessage(), Toast.LENGTH_SHORT).show();
Log.i("attach_database",e.getMessage());
}

}


I already searched and find this similar questions but problem still happens progressdialog-how-to-prevent-leaked-window



.

stackoverflow.comm

[android help] There are news about the development of a JavaScript Debugger for PhoneGap applications?


Preamble: I'm Italian, sorry for my bad English.


I'm working for a company that has asked me for help to improve one of its projects written using PhoneGap.


they asked me also to find a way to debug their javascript libraries in their project.


I know Ripple and Weinre but neither supports debugging JavaScript/PhoneGap. Ripple allows me to debug only the parts of code that do not refer to PhoneGap libraries (so, for example, I can not debug MySql queries, which are the basic things in their project) I tried searching on google but I have not found relevant alternative.


There are other ways that you recommend?


I know this question has been asked so many times, but I ask again hoping that over time there have been news, or that someone recommend me something I do not know yet.


Do you know if there are projects in development?



.

stackoverflow.comm

[General] Downloading or streaming English films from other EU countries.


Hi, I just bought my nice shiny new Nexus 10 and perhaps naively thought that I could stream or download (legally) films in my own language when I'm in France or Holland or wherever, as I don't spend much time in the UK now. Seems to me that I can't, unless someone can gently shove me in the right direction. Google Play will only offer me the French versions when I'm in France (where I live now) and other sites like Lovefilm say the service is unavailable outside certain countries. Seems a bit daft to me when I can order and get posted a DVD with no problem and pick up satellite tv as well without anyone knocking at the door.
It also seems that iTunes will do this for me - I didn't go and buy the wrong device did I? Please someone tell me I didn't............
Any advice out there?



.

forum.xda-developers.com

[android help] Sending Audio from Android phone to a linux device resulted in a constant scrambled sound


I've written a code that sends voice from an android device's mic to a PC(Ubuntu) through sockets (Static IP).


I've changed the audio format multiple times. The problem is that I receive only scrambled sound.


The Code On the Android:



public class VoiceTransThread implements Runnable{

@SuppressWarnings("deprecation")
public void run(){
int bufferReadResult;

frequency = 8000;
channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
try {

int bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding);
audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, frequency, channelConfiguration, audioEncoding, bufferSize);

short[] buffer = new short[bufferSize];
audioRecord.startRecording();

while(RecordingPermission){

bufferReadResult = audioRecord.read(buffer, 0, bufferSize);

for (int i = 0;i {

out.println(buffer[i]);

}
}


} catch (Throwable t) {
Log.e("Voice Command","Recording Failed");
}


}


}};


The code in the PC:



ssVoi = new ServerSocket(voiPort);
cVoi = ssVoi.accept();


Format = getAudioFormat();


byte[] tempArray = new byte[10000];
BufferedInputStream bis = new BufferedInputStream(cVoi.getInputStream());
ByteArrayInputStream bais = new ByteArrayInputStream(tempArray);
AudioFormat audioFormat = Format;
ais= new AudioInputStream(bais, audioFormat, tempArray.length / audioFormat.getFrameSize());


SourceDataLine sdl = AudioSystem.getSourceDataLine(Format);
sdl.open();
sdl.start();//start playing whatever is in this source data line


ArrayList byteArrayList = new ArrayList();
boolean interrupted = false;
while (!interrupted) {
int nextByte = 0;
while ((nextByte = bis.read()) != -1 && (byteArrayList.size() < 10000)) {
byteArrayList.add((byte) nextByte);
System.out.println(nextByte);
}
for (int i = 0; i < byteArrayList.size(); i++) {
tempArray[i] = byteArrayList.get(i);
}
byteArrayList.clear();
sdl.write(tempArray, 0, tempArray.length);

}


Please help!! I don't know what am I doing wrong??



.

stackoverflow.comm

[General] How to Backup SMS and photos from Stock Android


I've done a search, but I didn't find much.

I have a Galaxy Nexus, unrooted and with a locked bootloader. I want to root it, unlock it whatever and install some ROMs on it. I need to save all the texts and photos I've taken with it.

But most backup programs don't work without root/unlocked bootloader. I spent 6 hours trying to install Carbon App Sync to backup my files, but it doesn't offer me the option of saving to PC, which is what the free option is supposed to have. (I synced it with the Desktop program). I have the choice of saving to internal memory, which is great, except that the Gnex doesn't have a SD card (thanks for pushing us into using your cloud google) and so any backup I make will be wiped out when I root/unlock the bootloader.

It seems such a simple thing, but Android and all these apps have made it nearly impossible. I just want to get my texts and photos off this phone before I root it. How can I do this? Thanks.



.

forum.xda-developers.com

[android help] Speech Recognition on Unity Game Engine


I've succesfully achieved the goal of developing an app on android that use speech recognition from Google API.


But the fact is that I must use a real Game Engine because my app is going to be crossplatform and with a very rich User Interfacea and gestures.


I'm thinking on using Unity Game Engine and I'm going to deploy my app to iOS and Android platforms.


So... searching on web... I figured out that I can't use Google Speech Recognition API on Unity Game Engine becuase its belong to Google... Is that true?


Could you please give me an advice on how to implement this?


First option: Implement a third part library or Unity Speech Recognition API. Wich ones?


Second option (It's possible??): Modularize the package that convert speech to text, and call it via dynamic reflection. On Android deploy, use a Google API. On iOS deploy, use a iOS API (Unkown too).


Thank you in advance.



.

stackoverflow.comm

[android help] Android drawing a matrix

Android drawing a matrix - Stack Overflow




















Is it possible to draw a map (matrix-like structure) as an image on a particular layout (LinearLayout, etc.)? I am having a difficult time implementing such event.


For example I have this map input:



2222222222222
2-----2-----2
2--a--2--b--2
2-----2-----2
2222232222232


And I want to produce an image of the map (table-like structure) on a particular layout in which translation (rotation) and scaling is possible.


Can such be possible?


NOTE: There is no image file to derive. The map itself is to be generated as an image for translation and scaling.



UPDATE:


  • android.Graphics.Matrix wouldn't be a possible solution since there is no image file to derive the matrix. If an alternative is found to use Matrix it will be accepted.





























Matrix matrix = new Matrix();
matrix.postScale(scaleX, ScaleY);
matrix.postRotate(50);
matrix.postTranslate(xDisance, yDiastance);


You can achieve it by using Matrix Class. For more info on this check out the developer docs




















default







.

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