|
The past night, using my android phone, I have noticed the small voice of the Holy Spirit warning of a curse or other danger... Investigating to find it, through night vision the phone was a spotlight. Visually there was red dot barely visible in the corner. It was flashing a pattern..... The red color of an IR targeting laser, or multimode fiber laser meaning it was near infrared.
For now I have used electrical tape. But how can I access "INFRARED EMITTER" via an app.. What is his purpose on the phone to begin with. Why does it flash a pattern when it cannot be seen but through intention.
|
|
|
|
|
You need to stop smoking that stuff.
|
|
|
|
|
I notice you have not explain why the infrared emitter is there, or even deny it.
You just say I'm a weirdo for caring (apparently)
|
|
|
|
|
No, I just have no idea what you are talking about.
|
|
|
|
|
Richard MacCutchan wrote: I just have no idea what you are talking about.
So instead of ignoring the question which you did not understand, you get aggresive and make an condescending remark (because you did not understand something).. With voices like these companies become stagnant, because people are afraid to make a new idea.
|
|
|
|
|
Member 12717761 wrote: you get aggresive and make an condescending remark I was not in any way aggressive, I merely joked that your question sounded like it was posted by someone on drugs. If you have a proper technical question then please post proper technical details, and people will try to help you.
|
|
|
|
|
well i tried to brief my question but people here are more interested in attacking personally then discussing issues
here i put some more code to make users understand the issue,
Bitmap bitmap = null;
Uri uri = null;
if (destType == FILE_URI || destType == NATIVE_URI) {
if (this.saveToPhotoAlbum) {
Uri inputUri = getUriFromMediaStore();
try {
uri = Uri.fromFile(new File(FileHelper.getRealPath(inputUri, this.cordova)));
} catch (NullPointerException e) {
uri = null;
}
} else {
uri = Uri.fromFile(new File(getTempDirectoryPath(), System.currentTimeMillis() + ".jpg"));
}
if (uri == null) {
this.failPicture("Error capturing image - no media storage found.");
return;
}
if (this.targetHeight == -1 && this.targetWidth == -1 && this.mQuality == 100 &&
!this.correctOrientation) {
writeUncompressedImage(uri);
this.callbackContext.success(uri.toString());
} else {
bitmap = getScaledBitmap(FileHelper.stripFileProtocol(imageUri.toString()));
if (rotate != 0 && this.correctOrientation) {
bitmap = getRotatedBitmap(rotate, bitmap, exif);
}
try (OutputStream os = this.cordova.getActivity().getContentResolver().openOutputStream(uri)) {
bitmap.compress(Bitmap.CompressFormat.JPEG, this.mQuality, os);
}
|
|
|
|
|
Well we cannot understand unless you tell us what the problem is.
|
|
|
|
|
I have dont android development from quite some time, developed few projects.
I want to increase my knowledge, pleade recommend me some advance books on android
Thanks!
PS : I am not so confident in Broadcast Receivers and Services
|
|
|
|
|
|
Member 11828365 wrote: I want to increase my knowledge... Develop more projects.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Good evening
I want to realize multipages application. I have to use a slide menu (in left side); all page are reached by item in this menu and it should be visible in all pages.
In this moment I have realized slide menu in main application: an Activity, I have to implement the other pages but I don't know how to do it.
What is the best practice, in this case? Should the other pages be realized like subActivity starting them by StartActivityForResult? Or is it better starting them as indipendent pages whit StartActivity? In last case I must relicate the slide menu...
Thank you very much.
|
|
|
|
|
What do you mean by the term, "realize"? Does that mean to develop?
Creating this feature from scratch won't be a good idea, as you would have to handle many events such as drag events (for the drawer). What you need to use is, a Navigation Drawer activity. Navigation drawer supports the features that you need to use. That is how you see the applications to be working in Android with this feature. Android manages showing the list view of the drawer using the z-index in the application and the rest of the stuff would be managed by Android too, like showing the content, changing which layout or content to show etc.
For more on this, please go through, Creating a Navigation Drawer | Android Developers[^]
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I am able to make a bluetooth connection with a GNSS Device, but the problem is that, i am not able to stay connected with the device or in keeping the connection alive with the device in my entire application.
|
|
|
|
|
|
you could keep connection in a global manager instead of a activity, you can refer to this
|
|
|
|
|
How and where are you establishing said connection? What are you doing in methods like onPause() , onStop() , and onDestroy() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Here is the solution to keep the connection alive across the entire app :-
AsyncTask.execute(new Runnable() {
@Override
public void run() {
try {
bluetoothSocket = Globals.bluetoothDevice.createRfcommSocketToServiceRecord(Globals.DEFAULT_SPP_UUID);
bluetoothSocket.connect();
} catch (IOException e) {
e.printStackTrace();
}
no need to use those methods.
|
|
|
|
|
When you are Selecting A device to connect and when you are click on the device list item for requesting a connection to the device use AsyncTask
and put the connect method inside the AsyncTask like this :-
AsyncTask.execute(new Runnable() {
@Override
public void run() {
try {
bluetoothSocket = Globals.bluetoothDevice.createRfcommSocketToServiceRecord(Globals.DEFAULT_SPP_UUID);
bluetoothSocket.connect();
// After successful connect you can open InputStream
} catch (IOException e) {
e.printStackTrace();
}
Here is the full code for the same problem that i have cracked :-
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView parent, View view, int position, long id) {
lablelexconnected.setText("Connecting ...");
bdDevice = arrayListBluetoothDevices.get(position);
//bdClass = arrayListBluetoothDevices.get(position)
// Toast.makeText(getApplicationContext()," " + bdDevice.getAddress(),Toast.LENGTH_SHORT).show();
Log.i("Log", "The dvice : " + bdDevice.toString());
bdDevice = bluetoothAdapter.getRemoteDevice(bdDevice.getAddress());
Globals.bluetoothDevice = bluetoothAdapter.getRemoteDevice(bdDevice.getAddress());
System.out.println("Device in GPS Settings : " + bdDevice);
// startService(new Intent(getApplicationContext(),MyService.class));
/* Intent i = new Intent(GpsSettings.this, MyService.class);
startService(i);*/
// finish();
// connectDevice();
AsyncTask.execute(new Runnable() {
@Override
public void run() {
try {
bluetoothSocket = Globals.bluetoothDevice.createRfcommSocketToServiceRecord(Globals.DEFAULT_SPP_UUID);
bluetoothSocket.connect();
// After successful connect you can open InputStream
InputStream in = null;
in = bluetoothSocket.getInputStream();
InputStreamReader isr = new InputStreamReader(in);
br = new BufferedReader(isr);
while (found == 0) {
String nmeaMessage = br.readLine();
Log.d("NMEA", nmeaMessage);
// parse NMEA messages
sentence = nmeaMessage;
System.out.println("Sentence : " + sentence);
if (sentence.startsWith("$GPRMC")) {
String[] strValues = sentence.split(",");
System.out.println("StrValues : " + strValues[3] + " " + strValues[5] + " " + strValues[8]);
if (strValues[3].equals("") && strValues[5].equals("") && strValues[8].equals("")) {
Toast.makeText(getApplicationContext(), "Location Not Found !!! ", Toast.LENGTH_SHORT).show();
} else {
latitude = Double.parseDouble(strValues[3]);
if (strValues[4].charAt(0) == 'S') {
latitude = -latitude;
}
longitude = Double.parseDouble(strValues[5]);
if (strValues[6].charAt(0) == 'W') {
longitude = -longitude;
}
course = Double.parseDouble(strValues[8]);
// Toast.makeText(getApplicationContext(), "latitude=" + latitude + " ; longitude=" + longitude + " ; course = " + course, Toast.LENGTH_SHORT).show();
System.out.println("latitude=" + latitude + " ; longitude=" + longitude + " ; course = " + course);
// found = 1;
NMEAToDecimalConverter(latitude, longitude);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
});
}
});
BDW Richard MacCutchan this is my another account. I have solved My Problem.
modified 14-Sep-16 5:52am.
|
|
|
|
|
I have problem with layout in my application. I'm using list view and I have defined a custom list row. The program is correctly executed, but layout has some problem.
The space between two consecutive row is excessive...
This is XML code that I use in application layout (main) "activityMain.xml"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="No contents" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView" />
<ListView
android:id="@+id/listView_InfoOnLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:background="@drawable/bkgreen"
android:layout_marginTop="15dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="false"
android:footerDividersEnabled="false"
android:layout_alignParentEnd="true"
android:divider="@null"
android:dividerHeight="5dp"
android:layout_alignParentStart="true"
android:scrollIndicators="right"
android:clickable="true" />
</RelativeLayout>
and this is the custm row in XML resource ("list_row.xml")
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="90dip"
android:background="@drawable/bkglavander"
android:orientation="vertical"
android:padding="5dip" >
<!-- ListRow Left sied Image -->
<LinearLayout android:id="@+id/thumbnail"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="80dip"
android:padding="3dip"
android:layout_alignParentLeft="true"
android:background="@drawable/bkgorange"
android:layout_marginRight="5dip">
<ImageView
android:id="@+id/imaginiRSS"
android:layout_width="50dip"
android:layout_height="60dip"
android:src="@drawable/bkgblack"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true">
<!-- Title Of rss-->
<TextView
android:id="@+id/titoliRSS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=". TITLE"
android:textColor="#ff00aa00"
android:typeface="sans"
android:textSize="20dip"
android:layout_marginRight="5dip"
android:layout_marginLeft="5dip"
android:textStyle="bold"/>
<!-- Link -->
<TextView
android:id="@+id/linksRSS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@id/titoliRSS"
android:gravity="right"
android:text=". LINK"
android:layout_marginRight="5dip"
android:layout_marginLeft="5dip"
android:textSize="12dip"
android:textColor="#ff0000ff"
android:textStyle="bold"/>
<!-- Description -->
<TextView
android:id="@+id/descrizioniRSS"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/titoliRSS"
android:textColor="#343434"
android:textSize="15dip"
android:layout_marginRight="5dip"
android:layout_marginLeft="5dip"
android:layout_marginTop="1dip"
android:text=". DESC." />
</LinearLayout>
</LinearLayout>
</LinearLayout>
What is wrong, please?
|
|
|
|
|
Andy_Bell wrote: android:layout_height="90dip" Have you considered values other than 90 ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes of course. Reducing this value I can restrict row (defined in "list_row.xml") but the problem remain: space between 2 line remains the same.
I think it's like the problem is in ListView and not in the custom row.....
|
|
|
|
|
A picture would help.
You have a bunch of extra stuff on each of those widgets, both files. I would suggest trimming away everything that is not 100% necessary and then build them back up until the problem reappears.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Good evening.
I try to download picture form url and insert in Image View. I use this code to do it:
public Bitmap getBitmapFromURL(String src) {
Bitmap myBitmap = null;
try {
java.net.URL url = new java.net.URL(src);
HttpURLConnection connection = (HttpURLConnection) url
.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
myBitmap = BitmapFactory.decodeStream(input);
return myBitmap;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
I just want to ask you, there is problem to do so, or is it inefficient?
Closing this application, remains the downloaded picture remains in memory?
If I want to free memory resource, how can I cancel this files (accumulated in time)?
|
|
|
|
|
Andy_Bell wrote: Closing this application, remains the downloaded picture remains in memory? Only until the Android OS removes the application from memory. You could save space by immediately saving the bitmap on disk and only loading it into memory when you want to display it. Resources will get freed when the Bitmap object goes out of scop or is otherwise disposed.
|
|
|
|