android-intent

Android Barcode scanner using Zxing

◇◆丶佛笑我妖孽 提交于 2019-12-31 03:04:51
问题 I want to integrate Zxing in a android project (I'm a beginner). I have seen that the way described here http://bit.ly/nBszrL is discouraged and that the best way to do it is through Intents as said in this post http://bit.ly/o29Uma p.s : I don't want the barcode scanner installed on my device I have Included on my project the required class : http://bit.ly/16pKMKx my test code : package com.example.barcodescanner; import android.os.Bundle; import android.app.Activity; import android.content

Update data in Background Periodically (Android)

非 Y 不嫁゛ 提交于 2019-12-31 03:00:39
问题 The main objective of my app is, when a button is pressed: Collect data from the sensors Store data in the database Repeat periodically (every X seconds) I want to have it done in background, and if the Main Activity is destroyed, the background progress to be still running. So if you delete the activity, I want it still running. What I am doing right now, is having an AlarmManager with an Intent Service , to set the periodic recording of the Data, but whenever I destroy the Activity , as

How to Keep the CPU of android phone always awake?

隐身守侯 提交于 2019-12-31 02:43:10
问题 I have been stuck on it for days. I need to execute a function every minute. This function is making a POST call from the App to the Server and is transferring the location of the user per minute. The location coordinates are transferred for few hours, however, after few hours the transfer of location coordinates to the Server stops on its own. I am making use of WakefulBroadcastReceiver and IntentService to make sure that the CPU stays awake. I am also making use of Alarm to make sure that

How to communicate data between two fragments in a navigation drawer

吃可爱长大的小学妹 提交于 2019-12-31 02:22:08
问题 I have a navigation drawer which contains different fragments (each item display a fragment) and i'd like to pass data from a fragment to another.(I have just one activity that contain a navigation drawer in which a have a list of fragments). I have tried many solutions (Bundle and intent) but I couldn't solve my problem. Can any one help me pleaaase. This is my first Fragment A : package com.tutecentral.navigationdrawer; import android.app.Fragment; import android.content.Context; import

SharedPreferences return only default value

瘦欲@ 提交于 2019-12-31 01:34:13
问题 So instead of creating a database, I'm storing the data using SharedPreference . My code is below: SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit(); editor.putInt("favid"+id, 1); editor.commit(); Toast.makeText(getApplicationContext(), "Select as favorite", Toast.LENGTH_SHORT).show(); Now I want to retrieve that data so I have used below code in other activity : strFav = new ArrayList<Integer>(); if(strFav.size()>0) strFav.clear(); SharedPreferences prefs = getPreferences

SharedPreferences return only default value

安稳与你 提交于 2019-12-31 01:33:59
问题 So instead of creating a database, I'm storing the data using SharedPreference . My code is below: SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit(); editor.putInt("favid"+id, 1); editor.commit(); Toast.makeText(getApplicationContext(), "Select as favorite", Toast.LENGTH_SHORT).show(); Now I want to retrieve that data so I have used below code in other activity : strFav = new ArrayList<Integer>(); if(strFav.size()>0) strFav.clear(); SharedPreferences prefs = getPreferences

Send sms using sim selection option

扶醉桌前 提交于 2019-12-30 14:17:30
问题 I have tried Android SDK above 5.1 OS. I want to send sms using SIM selection option. I tried this Program. It's taking sim1 only. It does not take second sim. My Program public class MainActivity extends AppCompatActivity { Context mContext = MainActivity.this ; String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sendSMS("XXXXXXXX77","Sent by

Send sms using sim selection option

纵然是瞬间 提交于 2019-12-30 14:17:14
问题 I have tried Android SDK above 5.1 OS. I want to send sms using SIM selection option. I tried this Program. It's taking sim1 only. It does not take second sim. My Program public class MainActivity extends AppCompatActivity { Context mContext = MainActivity.this ; String SENT = "SMS_SENT"; String DELIVERED = "SMS_DELIVERED"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sendSMS("XXXXXXXX77","Sent by

Android task manager or system dialog

好久不见. 提交于 2019-12-30 13:50:13
问题 I would like to know is there a way to get events while displaying a System dialog (Such task manager, shut down alert,...). I can close the system dialogs from my activity through intent like below Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); sendBroadcast(closeDialog); But in my code I need to know a system dialog is shown over the screen (They can be Task manager/ Shut down dialog ...), so that I can invoke the above code for closing it. I searched for intent

Android task manager or system dialog

社会主义新天地 提交于 2019-12-30 13:49:37
问题 I would like to know is there a way to get events while displaying a System dialog (Such task manager, shut down alert,...). I can close the system dialogs from my activity through intent like below Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); sendBroadcast(closeDialog); But in my code I need to know a system dialog is shown over the screen (They can be Task manager/ Shut down dialog ...), so that I can invoke the above code for closing it. I searched for intent